mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Editor: Update npm WordPress npm packages.
This fixes a fatal error in the Navigation block, which was due to a reference to `WP_Navigation_Fallback_Gutenberg` that isn’t present in Core under that name. Follow-up to [56065]. Props ramonjd, isabel_brison, dmsnell. Fixes #58623. git-svn-id: https://develop.svn.wordpress.org/trunk@56076 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
507cab8d6f
commit
81bcd9d64e
2670
package-lock.json
generated
2670
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@ -84,9 +84,9 @@
|
||||
"@wordpress/api-fetch": "6.32.1",
|
||||
"@wordpress/autop": "3.35.1",
|
||||
"@wordpress/blob": "3.35.1",
|
||||
"@wordpress/block-directory": "4.12.2",
|
||||
"@wordpress/block-directory": "4.12.3",
|
||||
"@wordpress/block-editor": "12.3.2",
|
||||
"@wordpress/block-library": "8.12.2",
|
||||
"@wordpress/block-library": "8.12.3",
|
||||
"@wordpress/block-serialization-default-parser": "4.35.1",
|
||||
"@wordpress/blocks": "12.12.1",
|
||||
"@wordpress/commands": "0.6.2",
|
||||
@ -94,16 +94,16 @@
|
||||
"@wordpress/compose": "6.12.1",
|
||||
"@wordpress/core-commands": "0.4.2",
|
||||
"@wordpress/core-data": "6.12.2",
|
||||
"@wordpress/customize-widgets": "4.12.2",
|
||||
"@wordpress/customize-widgets": "4.12.3",
|
||||
"@wordpress/data": "9.5.1",
|
||||
"@wordpress/data-controls": "3.4.1",
|
||||
"@wordpress/date": "4.35.1",
|
||||
"@wordpress/deprecated": "3.35.1",
|
||||
"@wordpress/dom": "3.35.1",
|
||||
"@wordpress/dom-ready": "3.35.1",
|
||||
"@wordpress/edit-post": "7.12.2",
|
||||
"@wordpress/edit-site": "5.12.2",
|
||||
"@wordpress/edit-widgets": "5.12.2",
|
||||
"@wordpress/edit-post": "7.12.3",
|
||||
"@wordpress/edit-site": "5.12.3",
|
||||
"@wordpress/edit-widgets": "5.12.3",
|
||||
"@wordpress/editor": "13.12.2",
|
||||
"@wordpress/element": "5.12.1",
|
||||
"@wordpress/escape-html": "2.35.1",
|
||||
|
||||
@ -51,7 +51,7 @@ function render_block_core_latest_posts( $attributes ) {
|
||||
$filter_latest_posts_excerpt_more = static function( $more ) use ( $attributes ) {
|
||||
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
|
||||
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
|
||||
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>', 'gutenberg' ), esc_url( get_permalink() ) ) : $more;
|
||||
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
|
||||
};
|
||||
|
||||
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
|
||||
|
||||
@ -94,7 +94,7 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
*
|
||||
* @return string Submenu markup with the directives injected.
|
||||
*/
|
||||
function gutenberg_block_core_navigation_add_directives_to_submenu( $w, $block_attributes ) {
|
||||
function block_core_navigation_add_directives_to_submenu( $w, $block_attributes ) {
|
||||
while ( $w->next_tag(
|
||||
array(
|
||||
'tag_name' => 'LI',
|
||||
@ -124,7 +124,7 @@ if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
||||
};
|
||||
|
||||
// Iterate through subitems if exist.
|
||||
gutenberg_block_core_navigation_add_directives_to_submenu( $w, $block_attributes );
|
||||
block_core_navigation_add_directives_to_submenu( $w, $block_attributes );
|
||||
}
|
||||
return $w->get_updated_html();
|
||||
};
|
||||
@ -341,7 +341,11 @@ function block_core_navigation_get_fallback_blocks() {
|
||||
// If `core/page-list` is not registered then return empty blocks.
|
||||
$fallback_blocks = $registry->is_registered( 'core/page-list' ) ? $page_list_fallback : array();
|
||||
|
||||
$navigation_post = WP_Navigation_Fallback_Gutenberg::get_fallback();
|
||||
if ( class_exists( 'WP_Navigation_Fallback' ) ) {
|
||||
$navigation_post = WP_Navigation_Fallback::get_fallback();
|
||||
} else {
|
||||
$navigation_post = Gutenberg_Navigation_Fallback::get_fallback();
|
||||
}
|
||||
|
||||
// Use the first non-empty Navigation as fallback if available.
|
||||
if ( $navigation_post ) {
|
||||
@ -673,7 +677,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
||||
// Add directives to the submenu if needed.
|
||||
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && $has_submenus && $should_load_view_script ) {
|
||||
$w = new WP_HTML_Tag_Processor( $inner_blocks_html );
|
||||
$inner_blocks_html = gutenberg_block_core_navigation_add_directives_to_submenu( $w, $attributes );
|
||||
$inner_blocks_html = block_core_navigation_add_directives_to_submenu( $w, $attributes );
|
||||
}
|
||||
|
||||
$modal_unique_id = wp_unique_id( 'modal-' );
|
||||
@ -836,6 +840,8 @@ add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_back
|
||||
/**
|
||||
* Turns menu item data into a nested array of parsed blocks
|
||||
*
|
||||
* @deprecated 6.3.0 Use WP_Navigation_Fallback::parse_blocks_from_menu_items() instead.
|
||||
*
|
||||
* @param array $menu_items An array of menu items that represent
|
||||
* an individual level of a menu.
|
||||
* @param array $menu_items_by_parent_id An array keyed by the id of the
|
||||
@ -846,7 +852,7 @@ add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_back
|
||||
*/
|
||||
function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) {
|
||||
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::parse_blocks_from_menu_items' );
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::parse_blocks_from_menu_items' );
|
||||
|
||||
if ( empty( $menu_items ) ) {
|
||||
return array();
|
||||
@ -891,11 +897,13 @@ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_
|
||||
/**
|
||||
* Get the classic navigation menu to use as a fallback.
|
||||
*
|
||||
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback() instead.
|
||||
*
|
||||
* @return object WP_Term The classic navigation.
|
||||
*/
|
||||
function block_core_navigation_get_classic_menu_fallback() {
|
||||
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_classic_menu_fallback' );
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_classic_menu_fallback' );
|
||||
|
||||
$classic_nav_menus = wp_get_nav_menus();
|
||||
|
||||
@ -933,12 +941,14 @@ function block_core_navigation_get_classic_menu_fallback() {
|
||||
/**
|
||||
* Converts a classic navigation to blocks.
|
||||
*
|
||||
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_classic_menu_fallback_blocks() instead.
|
||||
*
|
||||
* @param object $classic_nav_menu WP_Term The classic navigation object to convert.
|
||||
* @return array the normalized parsed blocks.
|
||||
*/
|
||||
function block_core_navigation_get_classic_menu_fallback_blocks( $classic_nav_menu ) {
|
||||
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_classic_menu_fallback_blocks' );
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_classic_menu_fallback_blocks' );
|
||||
|
||||
// BEGIN: Code that already exists in wp_nav_menu().
|
||||
$menu_items = wp_get_nav_menu_items( $classic_nav_menu->term_id, array( 'update_post_term_cache' => false ) );
|
||||
@ -971,13 +981,15 @@ function block_core_navigation_get_classic_menu_fallback_blocks( $classic_nav_me
|
||||
}
|
||||
|
||||
/**
|
||||
* If there's a the classic menu then use it as a fallback.
|
||||
* If there's a classic menu then use it as a fallback.
|
||||
*
|
||||
* @deprecated 6.3.0 Use WP_Navigation_Fallback::create_classic_menu_fallback() instead.
|
||||
*
|
||||
* @return array the normalized parsed blocks.
|
||||
*/
|
||||
function block_core_navigation_maybe_use_classic_menu_fallback() {
|
||||
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::create_classic_menu_fallback' );
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::create_classic_menu_fallback' );
|
||||
|
||||
// See if we have a classic menu.
|
||||
$classic_nav_menu = block_core_navigation_get_classic_menu_fallback();
|
||||
@ -1016,11 +1028,13 @@ function block_core_navigation_maybe_use_classic_menu_fallback() {
|
||||
/**
|
||||
* Finds the most recently published `wp_navigation` Post.
|
||||
*
|
||||
* @deprecated 6.3.0 Use WP_Navigation_Fallback::get_most_recently_published_navigation() instead.
|
||||
*
|
||||
* @return WP_Post|null the first non-empty Navigation or null.
|
||||
*/
|
||||
function block_core_navigation_get_most_recently_published_navigation() {
|
||||
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback_Gutenberg::get_most_recently_published_navigation' );
|
||||
_deprecated_function( __FUNCTION__, '6.3.0', 'WP_Navigation_Fallback::get_most_recently_published_navigation' );
|
||||
|
||||
// Default to the most recently created menu.
|
||||
$parsed_args = array(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user