Make WordPress Core


Ignore:
Timestamp:
05/23/2024 07:37:08 PM (9 months ago)
Author:
ellatrix
Message:

Editor: Update npm packages.

Updates the editor npm packages to latest versions.

See https://github.com/WordPress/wordpress-develop/pull/6612.

Props ellatrix, mukesh27, youknowriad, mamaduka.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/navigation-submenu.php

    r56710 r58187  
    99 * Build an array with CSS classes and inline styles defining the font sizes
    1010 * which will be applied to the navigation markup in the front-end.
     11 *
     12 * @since 5.9.0
    1113 *
    1214 * @param  array $context Navigation block context.
     
    4446 * Returns the top-level submenu SVG chevron icon.
    4547 *
     48 * @since 5.9.0
     49 *
    4650 * @return string
    4751 */
     
    5256/**
    5357 * Renders the `core/navigation-submenu` block.
     58 *
     59 * @since 5.9.0
    5460 *
    5561 * @param array    $attributes The block attributes.
     
    8187    $kind        = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
    8288    $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    }
    8396
    8497    $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'];
     
    239252 * Register the navigation submenu block.
    240253 *
     254 * @since 5.9.0
     255 *
    241256 * @uses render_block_core_navigation_submenu()
    242257 * @throws WP_Error An WP_Error exception parsing the block definition.
Note: See TracChangeset for help on using the changeset viewer.