[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

Server-side rendering of the `core/navigation` block.

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

Defines 12 functions

  block_core_navigation_get_menu_items_at_location()
  block_core_navigation_sort_menu_items_by_parent_id()
  block_core_navigation_parse_blocks_from_menu_items()
  block_core_navigation_build_css_colors()
  block_core_navigation_build_css_font_sizes()
  block_core_navigation_render_submenu_icon()
  block_core_navigation_get_first_non_empty_navigation()
  block_core_navigation_filter_out_empty_blocks()
  block_core_navigation_get_fallback_blocks()
  render_block_core_navigation()
  register_block_core_navigation()
  block_core_navigation_typographic_presets_backcompatibility()

Functions
Functions that are not part of a class:

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

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

block_core_navigation_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.

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

block_core_navigation_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

return: array An array of parsed block data.
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

block_core_navigation_build_css_colors( $attributes )   X-Ref
Build an array with CSS classes and inline styles defining the colors
which will be applied to the navigation markup in the front-end.

return: array Colors CSS classes and inline styles.
param: array $attributes Navigation block attributes.

block_core_navigation_build_css_font_sizes( $attributes )   X-Ref
Build an array with CSS classes and inline styles defining the font sizes
which will be applied to the navigation markup in the front-end.

return: array Font size CSS classes and inline styles.
param: array $attributes Navigation block attributes.

block_core_navigation_render_submenu_icon()   X-Ref
Returns the top-level submenu SVG chevron icon.

return: string

block_core_navigation_get_first_non_empty_navigation()   X-Ref
Finds the first non-empty `wp_navigation` Post.

return: WP_Post|null the first non-empty Navigation or null.

block_core_navigation_filter_out_empty_blocks( $parsed_blocks )   X-Ref
Filter out empty "null" blocks from the block list.
'parse_blocks' includes a null block with '\n\n' as the content when
it encounters whitespace. This is not a bug but rather how the parser
is designed.

return: array the normalized parsed blocks.
param: array $parsed_blocks the parsed blocks to be normalized.

block_core_navigation_get_fallback_blocks()   X-Ref
No description

render_block_core_navigation( $attributes, $content, $block )   X-Ref
Renders the `core/navigation` block on server.

return: string Returns the post content with the legacy widget added.
param: array    $attributes The block attributes.
param: string   $content    The saved content.
param: WP_Block $block      The parsed block.

register_block_core_navigation()   X-Ref
Register the navigation block.


block_core_navigation_typographic_presets_backcompatibility( $parsed_block )   X-Ref
Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.

return: array The block being rendered without typographic presets.
param: array $parsed_block The block being rendered.



Generated: Sat Apr 27 01:00:02 2024 Cross-referenced by PHPXref 0.7.1