bricks_list_menus
Overview
Lists all WordPress navigation menus with their complete item hierarchies, assigned theme locations, and item counts. Each menu includes its items with title, URL, object type, and nested children for submenus.
Use this to discover existing menus before creating new ones, to find menu IDs for assignment to nav-menu elements, and to audit menu structures during the link reconciliation phase (Phase 4.7).
Key Features
When to Use
Before creating a new menu to avoid duplicates
To find menu IDs needed for bricks_assign_menu_to_element
During Phase 4.7 link reconciliation to audit menu links
To verify menu structure after creating or updating menus
When NOT to Use
When you need to check a specific page element — use bricks_get_page_content
Parameters
(none)noneoptionalCode Examples
Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12
List All Navigation Menus
Returns all menus with their items, locations, and counts. Use the returned menu ID in bricks_assign_menu_to_element or bricks_delete_menu.
bricks_list_menus()Common Mistakes
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47
Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018
Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48
Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Tips & Warnings
Menu locations: Available theme locations depend on the active theme. Common Bricks locations include « primary », « footer », and « mobile ». Check bricks_get_site_context for available locations.
Link reconciliation: After creating all pages in Phase 4, menus created earlier may still have placeholder « # » URLs. Use bricks_scan_links to find and bricks_update_links to fix these stale links.