Invalid argument supplied for foreach()
-
Hi,
After plugin installation, I got this warning if I try to edit a page:Warning: Invalid argument supplied for foreach() in /[…]/wp-content/plugins/wpglobus/includes/admin/class-wpglobus-wp-theme.php on line 104
By reading the code, I see that:
foreach ( $this->config['wpml-config']['admin-texts']['key']['key'] as $elem ) {
For me the stream$this->config['wpml-config']['admin-texts']
right before the code is the following one:array(1) { ["key"]=> array(23) { [0]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(22) "x_integrity_blog_title" } } [1]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(25) "x_integrity_blog_subtitle" } } [2]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(46) "x_integrity_portfolio_archive_sort_button_text" } } [3]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(18) "x_renew_blog_title" } } [4]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(16) "x_topbar_content" } } [5]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(16) "x_footer_content" } } [6]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(23) "x_custom_portfolio_slug" } } [7]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(21) "x_portfolio_tag_title" } } [8]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(32) "x_portfolio_launch_project_title" } } [9]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(38) "x_portfolio_launch_project_button_text" } } [10]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(31) "x_portfolio_share_project_title" } } [11]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(27) "x_buddypress_activity_title" } } [12]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(25) "x_buddypress_groups_title" } } [13]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(24) "x_buddypress_blogs_title" } } [14]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(26) "x_buddypress_members_title" } } [15]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(27) "x_buddypress_register_title" } } [16]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(27) "x_buddypress_activate_title" } } [17]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(30) "x_buddypress_activity_subtitle" } } [18]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(28) "x_buddypress_groups_subtitle" } } [19]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(27) "x_buddypress_blogs_subtitle" } } [20]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(29) "x_buddypress_members_subtitle" } } [21]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(30) "x_buddypress_register_subtitle" } } [22]=> array(1) { ["attr"]=> array(1) { ["name"]=> string(30) "x_buddypress_activate_subtitle" } } } }
Is the last
key
key relevant in the foreach ?
The only key that I’ve seen in the stream is the root one and the rest of the seems to match with the nested structure behind thekey
in the stream`. I don’t know wp nor if the stream readed may looks / be “recursive”.
My temporary fix was to drop out the last key:
$this->config['wpml-config']['admin-texts']['key']/*['key']*/
I suspect a plugin to interact in a bad way with the wp_globus (may be cornerstone).
Actually, it seems to be impossible to translate the site
- The topic ‘Invalid argument supplied for foreach()’ is closed to new replies.