[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/ -> class-wp-classic-to-block-menu-converter.php (summary)

WP_Classic_To_Block_Menu_Converter class

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

Defines 1 class

WP_Classic_To_Block_Menu_Converter:: (3 methods):
  convert()
  group_by_parent_id()
  to_blocks()


Class: WP_Classic_To_Block_Menu_Converter  - X-Ref

Converts a Classic Menu to Block Menu blocks.

convert( $menu )   X-Ref
Converts a Classic Menu to blocks.

param: WP_Term $menu The Menu term object of the menu to convert.
return: string|WP_Error The serialized and normalized parsed blocks on success,

group_by_parent_id( $menu_items )   X-Ref
Returns an array of menu items grouped by the id of the parent menu item.

param: array $menu_items An array of menu items.
return: array

to_blocks( $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 : Fri May 10 08:20:01 2024 Cross-referenced by PHPXref