PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Problem when adding fields and using WP core remove_submenu_page() function

  1. Hi there,

    just noticed there's an issue when adding new fields to an existing form and using the remove_submenu_page() function on special plugins, ie. like this:
    remove_submenu_page('index.php', 'relevanssi/relevanssi.php');

    the error log then throws a
    PHP Warning: Invalid argument supplied for foreach() in /.../wp-admin/includes/plugin.php on line 1286
    which is odd because the code there is the remove_menu_page function, actually not responsible for submenus items.
    The Fields are added though, so no critical issue so far.

    Don't know if it's really an GF-issue but afaik this warning is only thrown with GF on adding fields yet.

    Posted 11 years ago on Monday November 5, 2012 | Permalink
  2. I'll bring this to the attention of the developers. It's just a PHP warning which will not hurt the loading of your site, but it usually points to something that can be improved or done differently.

    Posted 11 years ago on Monday November 5, 2012 | Permalink
  3. Hey, just realized it was the wrong hook used to trigger the custom function.
    It had nothing to do with GravityForms since i also found this error on other core functions now.

    needed to use the correct hook 'admin_menu' instead according to this thread:
    http://wordpress.org/support/topic/using-remove_menu_page-causes-error-throughout-other-admin-sections

    so, all solved!

    regards,
    daniel

    Posted 11 years ago on Monday November 5, 2012 | Permalink
  4. Thank you for that update.

    Posted 11 years ago on Monday November 5, 2012 | Permalink

This topic has been resolved and has been closed to new replies.