mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-05 07:07:04 +00:00
Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Group - Fix inner container regexes using fixed div tag - Image block: Make sure the Image block border radius is inherited if the image is linked - Navigation: Small fixes - FSE: Add template_type guards - Template Part Block: Add some guards - Fix getEntityRecords to ensure resolution on REST API failure - Ensure menus before map operation in Nav block - Link editing: Account for link anchor no longer being present when generating unique link instance key - Navigation: Hide post attributes meta box - Fix failing tests and compatibility with 5.9. - Fix missing <MainDashboardButton> slot fill in site editor - Move WP_REST_Block_Navigation_Areas_Controller from Gutenberg to Core. - Fix site editor reset styles in WP 5.9 See #54337. git-svn-id: https://develop.svn.wordpress.org/trunk@52135 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -220,7 +220,11 @@ add_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 );
|
||||
* @return string Filtered block content.
|
||||
*/
|
||||
function wp_restore_group_inner_container( $block_content, $block ) {
|
||||
$group_with_inner_container_regex = '/(^\s*<div\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/';
|
||||
$tag_name = isset( $block['attrs']['tagName'] ) ? $block['attrs']['tagName'] : 'div';
|
||||
$group_with_inner_container_regex = sprintf(
|
||||
'/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*<div\b[^>]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/',
|
||||
preg_quote( $tag_name, '/' )
|
||||
);
|
||||
|
||||
if (
|
||||
'core/group' !== $block['blockName'] ||
|
||||
@@ -231,7 +235,10 @@ function wp_restore_group_inner_container( $block_content, $block ) {
|
||||
return $block_content;
|
||||
}
|
||||
|
||||
$replace_regex = '/(^\s*<div\b[^>]*wp-block-group[^>]*>)(.*)(<\/div>\s*$)/ms';
|
||||
$replace_regex = sprintf(
|
||||
'/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms',
|
||||
preg_quote( $tag_name, '/' )
|
||||
);
|
||||
$updated_content = preg_replace_callback(
|
||||
$replace_regex,
|
||||
static function( $matches ) {
|
||||
|
||||
@@ -55,7 +55,10 @@ function render_block_core_template_part( $attributes ) {
|
||||
// render the corresponding file content.
|
||||
$template_part_file_path = get_theme_file_path( '/block-template-parts/' . $attributes['slug'] . '.html' );
|
||||
if ( 0 === validate_file( $attributes['slug'] ) && file_exists( $template_part_file_path ) ) {
|
||||
$content = _inject_theme_attribute_in_block_template_content( file_get_contents( $template_part_file_path ) );
|
||||
$content = file_get_contents( $template_part_file_path );
|
||||
$content = is_string( $content ) && '' !== $content
|
||||
? _inject_theme_attribute_in_block_template_content( $content )
|
||||
: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user