Contact Form DB
[resolved] Error with remove_menu_page() on export (2 posts)

  1. dcrosbie
    Posted 3 years ago #

    I have 2 types of users - Admin and Contributor (with most privileges turned off for Contributor).

    For the Contributor I use remove_menu_page() WordPress function to hide unnecessary menu items. This works fine when the Contributor logs in and looks around, but as soon as they try to export their data they get this error inside the remove_menu_page() code:

    Warning: Invalid argument supplied for foreach() in /home/content/68/4872368/html/wp-admin/includes/plugin.php on line 1286

    This error doesn't happen from the administrator's id which does not use remove_menu_page(). I can export no problem under administrator userid.

    I am calling the remove_menu_page function during the admin_init action. It looks like maybe this action is being triggered a 2nd time during export and that is why the menu's do not exist that 2nd time to be removed. Or... is this just a permission issue that I need some extra roles set up for the Contributor??

    Any thoughts?


  2. dcrosbie
    Posted 3 years ago #

    I love it when this happens, I found my solution thanks to google and other handy wordpress users!

    See solution here:

    No a problem with this plugin at all.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form DB
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.