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

    r57888 r58187  
    88/**
    99 * Helper functions used to render the navigation block.
     10 *
     11 * @since 6.5.0
    1012 */
    1113class WP_Navigation_Block_Renderer {
     
    1315    /**
    1416     * Used to determine whether or not a navigation has submenus.
     17     *
     18     * @since 6.5.0
    1519     */
    1620    private static $has_submenus = false;
     
    1822    /**
    1923     * Used to determine which blocks need an <li> wrapper.
     24     *
     25     * @since 6.5.0
    2026     *
    2127     * @var array
     
    2430        'core/site-title',
    2531        'core/site-logo',
     32        'core/social-links',
    2633    );
    2734
     
    2936     * Keeps track of all the navigation names that have been seen.
    3037     *
     38     * @since 6.5.0
     39     *
    3140     * @var array
    3241     */
     
    3544    /**
    3645     * Returns whether or not this is responsive navigation.
     46     *
     47     * @since 6.5.0
    3748     *
    3849     * @param array $attributes The block attributes.
     
    5061    /**
    5162     * Returns whether or not a navigation has a submenu.
     63     *
     64     * @since 6.5.0
    5265     *
    5366     * @param WP_Block_List $inner_blocks The list of inner blocks.
     
    88101     * Determine whether the navigation blocks is interactive.
    89102     *
     103     * @since 6.5.0
     104     *
    90105     * @param array         $attributes   The block attributes.
    91106     * @param WP_Block_List $inner_blocks The list of inner blocks.
     
    100115    /**
    101116     * Returns whether or not a block needs a list item wrapper.
     117     *
     118     * @since 6.5.0
    102119     *
    103120     * @param WP_Block $block The block.
     
    127144     * Returns the markup for a single inner block.
    128145     *
     146     * @since 6.5.0
     147     *
    129148     * @param WP_Block $inner_block The inner block.
    130149     * @return string Returns the markup for a single inner block.
     
    143162    /**
    144163     * Returns the html for the inner blocks of the navigation block.
     164     *
     165     * @since 6.5.0
    145166     *
    146167     * @param array         $attributes   The block attributes.
     
    201222     * Gets the inner blocks for the navigation block from the navigation post.
    202223     *
     224     * @since 6.5.0
     225     *
    203226     * @param array $attributes The block attributes.
    204227     * @return WP_Block_List Returns the inner blocks for the navigation block.
     
    236259     * Gets the inner blocks for the navigation block from the fallback.
    237260     *
     261     * @since 6.5.0
     262     *
    238263     * @param array $attributes The block attributes.
    239264     * @return WP_Block_List Returns the inner blocks for the navigation block.
     
    252277    /**
    253278     * Gets the inner blocks for the navigation block.
     279     *
     280     * @since 6.5.0
    254281     *
    255282     * @param array    $attributes The block attributes.
     
    311338     * Gets the name of the current navigation, if it has one.
    312339     *
     340     * @since 6.5.0
     341     *
    313342     * @param array $attributes The block attributes.
    314343     * @return string Returns the name of the navigation.
     
    346375     * Returns the layout class for the navigation block.
    347376     *
     377     * @since 6.5.0
     378     *
    348379     * @param array $attributes The block attributes.
    349380     * @return string Returns the layout class for the navigation block.
     
    376407    /**
    377408     * Return classes for the navigation block.
     409     *
     410     * @since 6.5.0
    378411     *
    379412     * @param array $attributes The block attributes.
     
    404437     * Get styles for the navigation block.
    405438     *
     439     * @since 6.5.0
     440     *
    406441     * @param array $attributes The block attributes.
    407442     * @return string Returns the styles for the navigation block.
     
    416451    /**
    417452     * Get the responsive container markup
     453     *
     454     * @since 6.5.0
    418455     *
    419456     * @param array         $attributes The block attributes.
     
    515552     * Get the wrapper attributes
    516553     *
     554     * @since 6.5.0
     555     *
    517556     * @param array         $attributes    The block attributes.
    518557     * @param WP_Block_List $inner_blocks  A list of inner blocks.
     
    543582    /**
    544583     * Gets the nav element directives.
     584     *
     585     * @since 6.5.0
    545586     *
    546587     * @param bool $is_interactive Whether the block is interactive.
     
    574615     * Handle view script module loading.
    575616     *
     617     * @since 6.5.0
     618     *
    576619     * @param array         $attributes   The block attributes.
    577620     * @param WP_Block      $block        The parsed block.
     
    598641     * Returns the markup for the navigation block.
    599642     *
     643     * @since 6.5.0
     644     *
    600645     * @param array         $attributes The block attributes.
    601646     * @param WP_Block_List $inner_blocks The list of inner blocks.
     
    612657    /**
    613658     * Returns a unique name for the navigation.
     659     *
     660     * @since 6.5.0
    614661     *
    615662     * @param array $attributes The block attributes.
     
    631678    /**
    632679     * Renders the navigation block.
     680     *
     681     * @since 6.5.0
    633682     *
    634683     * @param array    $attributes The block attributes.
     
    677726     * Returns the menu items for a WordPress menu location.
    678727     *
     728     * @since 5.9.0
     729     *
    679730     * @param string $location The menu location.
    680731     * @return array Menu items for the location.
     
    713764     * id of the parent menu.
    714765     *
     766     * @since 5.9.0
     767     *
    715768     * @param array $menu_items Menu items to sort.
    716769     * @return array An array keyed by the id of the parent menu where each element
     
    735788     * Gets the inner blocks for the navigation block from the unstable location attribute.
    736789     *
     790     * @since 6.5.0
     791     *
    737792     * @param array $attributes The block attributes.
    738793     * @return WP_Block_List Returns the inner blocks for the navigation block.
     
    753808 * Add Interactivity API directives to the navigation-submenu and page-list
    754809 * blocks markup using the Tag Processor.
     810 *
     811 * @since 6.3.0
    755812 *
    756813 * @param WP_HTML_Tag_Processor $tags             Markup of the navigation block.
     
    815872 * which will be applied to the navigation markup in the front-end.
    816873 *
     874 * @since 5.9.0
     875 *
    817876 * @param array $attributes Navigation block attributes.
    818877 *
     
    906965 * which will be applied to the navigation markup in the front-end.
    907966 *
     967 * @since 5.9.0
     968 *
    908969 * @param array $attributes Navigation block attributes.
    909970 *
     
    934995 * Returns the top-level submenu SVG chevron icon.
    935996 *
     997 * @since 5.9.0
     998 *
    936999 * @return string
    9371000 */
     
    9451008 * it encounters whitespace. This is not a bug but rather how the parser
    9461009 * is designed.
     1010 *
     1011 * @since 5.9.0
    9471012 *
    9481013 * @param array $parsed_blocks the parsed blocks to be normalized.
     
    9641029 * Returns true if the navigation block contains a nested navigation block.
    9651030 *
     1031 * @since 6.2.0
     1032 *
    9661033 * @param WP_Block_List $inner_blocks Inner block instance to be normalized.
    9671034 * @return bool true if the navigation block contains a nested navigation block.
     
    9861053 * This aims to mirror how the fallback mechanic for wp_nav_menu works.
    9871054 * See https://developer.wordpress.org/reference/functions/wp_nav_menu/#more-information.
     1055 *
     1056 * @since 5.9.0
    9881057 *
    9891058 * @return array the array of blocks to be used as a fallback.
     
    10421111 * Iterate through all inner blocks recursively and get navigation link block's post IDs.
    10431112 *
     1113 * @since 6.0.0
     1114 *
    10441115 * @param WP_Block_List $inner_blocks Block list class instance.
    10451116 *
     
    10541125 * Get post IDs from a navigation link block instance.
    10551126 *
     1127 * @since 6.0.0
     1128 *
    10561129 * @param WP_Block $block Instance of a block.
    10571130 *
     
    10771150 * Renders the `core/navigation` block on server.
    10781151 *
     1152 * @since 5.9.0
     1153 *
    10791154 * @param array    $attributes The block attributes.
    10801155 * @param string   $content    The saved content.
     
    10891164/**
    10901165 * Register the navigation block.
     1166 *
     1167 * @since 5.9.0
    10911168 *
    10921169 * @uses render_block_core_navigation()
     
    11061183/**
    11071184 * Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
     1185 *
     1186 * @since 5.9.0
    11081187 *
    11091188 * @param array $parsed_block The block being rendered.
     
    11411220 * Turns menu item data into a nested array of parsed blocks
    11421221 *
     1222 * @since 5.9.0
     1223 *
    11431224 * @deprecated 6.3.0 Use WP_Navigation_Fallback::parse_blocks_from_menu_items() instead.
    11441225 *
     
    11981279 * Get the classic navigation menu to use as a fallback.
    11991280 *
     1281 * @since 6.2.0
     1282 *
    12001283 * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead.
    12011284 *
     
    12421325 * Converts a classic navigation to blocks.
    12431326 *
     1327 * @since 6.2.0
     1328 *
    12441329 * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback_blocks() instead.
    12451330 *
     
    12831368/**
    12841369 * If there's a classic menu then use it as a fallback.
     1370 *
     1371 * @since 6.2.0
    12851372 *
    12861373 * @deprecated 6.3.0 Use WP_Navigation_Fallback::create_classic_menu_fallback() instead.
     
    13291416 * Finds the most recently published `wp_navigation` Post.
    13301417 *
     1418 * @since 6.1.0
     1419 *
    13311420 * @deprecated 6.3.0 Use WP_Navigation_Fallback::get_most_recently_published_navigation() instead.
    13321421 *
     
    13601449 * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks.
    13611450 *
     1451 * @since 6.5.0
     1452 *
    13621453 * @param string $serialized_block The serialized markup of a block and its inner blocks.
    13631454 * @return string
     
    13721463 * Mock a parsed block for the Navigation block given its inner blocks and the `wp_navigation` post object.
    13731464 * The `wp_navigation` post's `_wp_ignored_hooked_blocks` meta is queried to add the `metadata.ignoredHookedBlocks` attribute.
     1465 *
     1466 * @since 6.5.0
    13741467 *
    13751468 * @param array   $inner_blocks Parsed inner blocks of a Navigation block.
     
    14121505 * of those hooked blocks should be exempted from insertion.
    14131506 *
     1507 * @since 6.5.0
     1508 *
    14141509 * @param array   $inner_blocks Parsed inner blocks of a Navigation block.
    14151510 * @param WP_Post $post         `wp_navigation` post object corresponding to the block.
     
    14371532 * mock Navigation block wrapper.
    14381533 *
     1534 * @since 6.5.0
     1535 *
    14391536 * @param array   $inner_blocks Parsed inner blocks of a Navigation block.
    14401537 * @param WP_Post $post         `wp_navigation` post object corresponding to the block.
     
    15401637 * Hooks into the REST API response for the core/navigation block and adds the first and last inner blocks.
    15411638 *
     1639 * @since 6.5.0
     1640 *
    15421641 * @param WP_REST_Response $response The response object.
    15431642 * @param WP_Post          $post     Post object.
     
    15541653    $content = block_core_navigation_remove_serialized_parent_block( $content );
    15551654
    1556     $response->data['content']['raw']      = $content;
     1655    $response->data['content']['raw'] = $content;
     1656
     1657    /** This filter is documented in wp-includes/post-template.php */
    15571658    $response->data['content']['rendered'] = apply_filters( 'the_content', $content );
    15581659
Note: See TracChangeset for help on using the changeset viewer.