• Hello, the plugin has a good functionality, the more this occurs the following error when I try to access it:
    Warning: Invalid argument supplied for foreach () in D: \ wamp \ www \ wordpteste \ wp-content \ plugins \ IM8-box-hide \ IM8-box-hide.php on line 133

    Warning: Invalid argument supplied for foreach () in D: \ wamp \ www \ wordpteste \ wp-content \ plugins \ IM8-box-hide \ IM8-box-hide.php on line 138

    What could it be?

    http://wordpress.org/extend/plugins/im8-box-hide/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,
    can you please give me more details of ur wordpress configuration? Which version and which additional plugins you have installed? If u provide me with the informations im gonna fix the bug… thank you

    Greetz … IM8

    to fix, replace

    foreach($wp_meta_boxes['post'] as $context)
    			foreach($context as $priority)
    				foreach($priority as $box)
    					array_push($this->postboxes,array($box['id'],$box['title']));
    
    		foreach($wp_meta_boxes['page'] as $context)
    			foreach($context as $priority)
    				foreach($priority as $box)
    					array_push($this->pageboxes,array($box['id'],$box['title']));

    with

    if ($wp_meta_boxes['post']) {
    		foreach($wp_meta_boxes['post'] as $context)
    			foreach($context as $priority)
    				foreach($priority as $box)
    					array_push($this->postboxes,array($box['id'],$box['title']));
    	}
    	if ($wp_meta_boxes['page']) {
    		foreach($wp_meta_boxes['page'] as $context)
    			foreach($context as $priority)
    				foreach($priority as $box)
    					array_push($this->pageboxes,array($box['id'],$box['title']));
    	}

    ie, wrap foreach with condition check, if ($wp_meta_boxes[‘page’]) { ….

    Great! Thanks for ur support straddieplastic!

    I will roll out a bugfix update …

    Hi,

    Small errors too on lines 45 and 48 of im8-box-hide.php:

    Replace:

    foreach ($hide[$user_role]['post'] as $box => $value)
    			foreach (array('normal', 'advanced', 'side') as $context) remove_meta_box($box, 'post', $context);
    
    		foreach ($hide[$user_role]['page'] as $box => $value)
    			foreach (array('normal', 'advanced', 'side') as $context) remove_meta_box($box, 'page', $context);

    with

    if($hide[$user_role]['post']){
    		foreach ($hide[$user_role]['post'] as $box => $value)
    			foreach (array('normal', 'advanced', 'side') as $context) remove_meta_box($box, 'post', $context);
    		}
    
    		if($hide[$user_role]['page']){
    		foreach ($hide[$user_role]['page'] as $box => $value)
    			foreach (array('normal', 'advanced', 'side') as $context) remove_meta_box($box, 'page', $context);
    		}

    Seems to fix the similar issues (this is on WordPress 3.0 btw).

    Will you be implementing options for custom post types? Just a thought – I manage them myself at the moment and create/hide the meta boxes when I actually create the custom post types, but others may find this handy! Thanks for a great plugin.

    Nice! I will fix this tomorrow and rollout the update… thanks!

    But i dont understand what u mean with options for custom post types? i guess u mean the same like for additional plugins? so u can disable metaboxes on these custom write pages?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: IM8 Box Hide] This error occurs when accessing the plugin!’ is closed to new replies.