[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> navigation-areas.php (summary)

Block navigation areas functions.

File Size: 262 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions

  register_navigation_areas()
  _wp_register_default_navigation_areas()
  get_navigation_areas()
  _wp_migrate_menu_to_navigation_post()
  _wp_get_menu_items_at_location()
  _wp_sort_menu_items_by_parent_id()
  _wp_parse_blocks_from_menu_items()

Functions
Functions that are not part of a class:

register_navigation_areas( $new_areas )   X-Ref
Registers the navigation areas supported by the current theme. The expected
shape of the argument is:
array(
'primary'   => 'Primary',
'secondary' => 'Secondary',
'tertiary'  => 'Tertiary',
)

param: array $new_areas Supported navigation areas.

_wp_register_default_navigation_areas()   X-Ref
Register the default navigation areas.


get_navigation_areas()   X-Ref
Returns the available navigation areas.

return: array Registered navigation areas.

_wp_migrate_menu_to_navigation_post( $new_name, WP_Theme $new_theme, WP_Theme $old_theme )   X-Ref
Migrates classic menus to a block-based navigation post on theme switch.
Assigns the created navigation post to the corresponding navigation area.

param: string   $new_name  Name of the new theme.
param: WP_Theme $new_theme New theme.
param: WP_Theme $old_theme Old theme.

_wp_get_menu_items_at_location( $location )   X-Ref
Returns the menu items for a WordPress menu location.

param: string $location The menu location.
return: array Menu items for the location.

_wp_sort_menu_items_by_parent_id( $menu_items )   X-Ref
Sorts a standard array of menu items into a nested structure keyed by the
id of the parent menu.

param: array $menu_items Menu items to sort.
return: array An array keyed by the id of the parent menu where each element

_wp_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id )   X-Ref
Turns menu item data into a nested array of parsed blocks

param: array $menu_items               An array of menu items that represent
param: array $menu_items_by_parent_id  An array keyed by the id of the
return: array An array of parsed block data.



Generated : Mon Nov 29 08:20:03 2021 Cross-referenced by PHPXref