Support » Plugin: If Menu - Visibility control for Menus » PHP Warning: Invalid argument supplied for foreach() if-menu.php on line 223

  • Resolved rrecurse

    (@rrecurse)


    Were using a plugin called NestedPages:

    https://wordpress.org/plugins/wp-nested-pages/

    It’s a simple admin page position editor. It also provides an option to keep menu in sync with new or moved pages.

    When selecting the “Sync Menu” option at the top of the WordPress admin page manager (the option provided by the Nested Pages plugin), the following warning is triggered:

    PHP Warning: Invalid argument supplied for foreach() in /wp-content/plugins/if-menu/if-menu.php on line 223

    You can reproduce this by installing Nested Pages plugin and then checking the “Sync Menu” checkbox at the top of the page manager. Checking it on and off will produce this issue.

    The issue stems from $_POST[‘menu-item-if-menu-enable’][$menu_item_db_id] not being set or is not an array. I can reach out to the plugin author and request he consider compatibility with other plugins such as if-menu, but I need some details as to where this is expected to be set from.

    Thanks!

    https://wordpress.org/plugins/if-menu/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrei

    (@andreiigna)

    Hi

    I’ll take a look at the plugins and let you know how to fix this

    Plugin Author Andrei

    (@andreiigna)

    Thanks for letting me know about this issue.

    I’ve made some code changes in the latest version of the plugin and this should be resolved now.

    Thread Starter rrecurse

    (@rrecurse)

    Thank you for resolving! Can confirm everything works and no more warnings.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Warning: Invalid argument supplied for foreach() if-menu.php on line 223’ is closed to new replies.