Changeset 58187 for trunk/src/wp-includes/blocks/navigation-submenu.php
- Timestamp:
- 05/23/2024 07:37:08 PM (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/navigation-submenu.php
r56710 r58187 9 9 * Build an array with CSS classes and inline styles defining the font sizes 10 10 * which will be applied to the navigation markup in the front-end. 11 * 12 * @since 5.9.0 11 13 * 12 14 * @param array $context Navigation block context. … … 44 46 * Returns the top-level submenu SVG chevron icon. 45 47 * 48 * @since 5.9.0 49 * 46 50 * @return string 47 51 */ … … 52 56 /** 53 57 * Renders the `core/navigation-submenu` block. 58 * 59 * @since 5.9.0 54 60 * 55 61 * @param array $attributes The block attributes. … … 81 87 $kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] ); 82 88 $is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind ); 89 90 if ( is_post_type_archive() ) { 91 $queried_archive_link = get_post_type_archive_link( get_queried_object()->name ); 92 if ( $attributes['url'] === $queried_archive_link ) { 93 $is_active = true; 94 } 95 } 83 96 84 97 $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon']; … … 239 252 * Register the navigation submenu block. 240 253 * 254 * @since 5.9.0 255 * 241 256 * @uses render_block_core_navigation_submenu() 242 257 * @throws WP_Error An WP_Error exception parsing the block definition.
Note: See TracChangeset
for help on using the changeset viewer.