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-link.php

    r57663 r58187  
    99 * Build an array with CSS classes and inline styles defining the colors
    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.
     
    7981 * Build an array with CSS classes and inline styles defining the font sizes
    8082 * which will be applied to the navigation markup in the front-end.
     83 *
     84 * @since 5.9.0
    8185 *
    8286 * @param  array $context Navigation block context.
     
    114118 * Returns the top-level submenu SVG chevron icon.
    115119 *
     120 * @since 5.9.0
     121 *
    116122 * @return string
    117123 */
     
    122128/**
    123129 * Decodes a url if it's encoded, returning the same url if not.
     130 *
     131 * @since 6.2.0
    124132 *
    125133 * @param string $url The url to decode.
     
    153161/**
    154162 * Renders the `core/navigation-link` block.
     163 *
     164 * @since 5.9.0
    155165 *
    156166 * @param array    $attributes The block attributes.
     
    188198    $kind        = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
    189199    $is_active   = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
     200
     201    if ( is_post_type_archive() ) {
     202        $queried_archive_link = get_post_type_archive_link( get_queried_object()->name );
     203        if ( $attributes['url'] === $queried_archive_link ) {
     204            $is_active = true;
     205        }
     206    }
    190207
    191208    $wrapper_attributes = get_block_wrapper_attributes(
     
    269286/**
    270287 * Returns a navigation link variation
     288 *
     289 * @since 5.9.0
    271290 *
    272291 * @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity.
     
    392411 * Registers the navigation link block.
    393412 *
     413 * @since 5.9.0
     414 *
    394415 * @uses render_block_core_navigation_link()
    395416 * @throws WP_Error An WP_Error exception parsing the block definition.
Note: See TracChangeset for help on using the changeset viewer.