I'm getting this error every time I add an item (page, post or category) to my menu system:
Warning: Invalid argument supplied for foreach() in /home/rootname/public_html/wp-admin/includes/plugin.php line 1261
I also can't insert links to internal pages from within the WYSIWYG editor (no pagesappear in the list).
I guess it could be a theme-server conflict issue as I have an identical set up (same theme, plugins etc) on my localhost which is working ok, it's just the live site that is having issues...
Any ideas of what I should do?
Thanks,
Osu
EDIT
Ok, I've found the root of the problem - it's to do with a function in my functions.php file:
/* Remove admin end options */
add_action( 'admin_init', 'osu_remove_menu_pages' );
function osu_remove_menu_pages() {
remove_menu_page('link-manager.php');
remove_submenu_page('themes.php', 'themes.php');
remove_submenu_page('themes.php', 'widgets.php');
remove_submenu_page('plugins.php', 'plugin-editor.php');
remove_submenu_page('users.php', 'user-role-editor.php');
// remove_submenu_page('index.php', 'update-core.php');
}
I'm using it to remove some options on the admin end and would prefer to keep this function if possible just to make the admin end less cluttered. Can anyone see why that might be conflicting with the link system in WP 3.2.1?
Thanks