PHP Warning: Invalid argument supplied for foreach() if-menu.php on line 223
-
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!
- The topic ‘PHP Warning: Invalid argument supplied for foreach() if-menu.php on line 223’ is closed to new replies.