| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Server-side rendering of the `core/navigation-submenu` block.
| File Size: | 342 lines (12 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 2 files wp-includes/blocks/navigation-link/shared/item-should-render.php wp-includes/blocks/navigation-link/shared/render-submenu-icon.php |
| block_core_navigation_submenu_get_submenu_visibility( $context ) X-Ref |
| Returns the submenu visibility value with backward compatibility for the deprecated openSubmenusOnClick attribute. This function centralizes the migration logic from the boolean openSubmenusOnClick to the new submenuVisibility enum. Backward compatibility handling: - Legacy blocks (saved before migration, never opened in editor): Have openSubmenusOnClick in database. Parent Navigation block passes it via context. We prioritize openSubmenusOnClick to preserve the original behavior. - Migrated blocks (opened in editor after migration): JavaScript deprecation removes openSubmenusOnClick and sets submenuVisibility. We use submenuVisibility since openSubmenusOnClick is null. - New blocks (created after migration): Only have submenuVisibility, openSubmenusOnClick is null. We use submenuVisibility. return: string The visibility mode: 'hover', 'click', or 'always'. param: array $context Block context from parent Navigation block. |
| block_core_navigation_submenu_build_css_font_sizes( $context ) 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 $context Navigation block context. |
| render_block_core_navigation_submenu( $attributes, $content, $block ) X-Ref |
| Renders the `core/navigation-submenu` block. 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_submenu() X-Ref |
| Register the navigation submenu block. |
| Generated : Tue Jun 16 08:20:09 2026 | Cross-referenced by PHPXref |