Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I noticed today that my error logs are littered with this information. I'm not quite sure what's causing it. Has anyone seen this before?

[Mon Mar 25 17:24:23 2013] [error] [client] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/mysite/wp-admin/includes/plugin.php on line 1290, referer: http://mysite/contact/

Line 1290 is the foreach in the following code. I am not sure what's referencing this or where to begin looking.

/**
 * Remove a top level admin menu
 *
 * @since 3.1.0
 *
 * @param string $menu_slug The slug of the menu
 * @return array|bool The removed menu on success, False if not found
 */

function remove_menu_page( $menu_slug ) {
global $menu;

foreach ( $menu as $i => $item ) {
    if ( $menu_slug == $item[2] ) {
        unset( $menu[$i] );
        return $item;
    }
}

return false;
}

I'm not hooking into admin_menu as far as I can tell.

Any ideas?

share|improve this question
1  
This is most likely caused by a plugin. Deactivate them all, and reactivate one by one. –  vancoder Mar 25 '13 at 21:34
    
Looks like I narrowed it down to a plugin, which tells me I must have been getting this error for a few months and just didn't notice. Pop that one liner into an answer and I'll check it off for you. Thanks @vancoder –  Pat Mar 25 '13 at 22:04
    
Was it a Twitter (or twitter related) plugin perchance? they've recently updated their API so a lot of plugins are failing. –  vancoder Mar 25 '13 at 22:15
    
No it was WP Most Popular (which for what it's worth, never seemed to work rock-solid anyways). wordpress.org/extend/plugins/wp-most-popular –  Pat Mar 25 '13 at 22:16
add comment

1 Answer

up vote 1 down vote accepted

This is most likely caused by a plugin. Deactivate them all, and reactivate one by one.

share|improve this answer
    
Thanks for the easy fix! –  Pat Mar 25 '13 at 22:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.