WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. dcrosbie
    Member
    Posted 1 year 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?

    http://wordpress.org/extend/plugins/contact-form-7-to-database-extension/

  2. dcrosbie
    Member
    Posted 1 year ago #

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

    See solution here:
    http://wordpress.org/support/topic/using-remove_menu_page-causes-error-throughout-other-admin-sections?replies=5

    No a problem with this plugin at all.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.