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

param: string $location The menu location.
return: array Menu items for the 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.

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

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

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.

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.

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

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.

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

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.

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

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.

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

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.

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



Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1