@wordpress/block-library 7.14.10 → 7.14.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cover/edit/index.js +3 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/list/utils.js +4 -8
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +2 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/page-list/edit.js +29 -10
- package/build/page-list/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +3 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/list/utils.js +5 -9
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +2 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/page-list/edit.js +29 -10
- package/build-module/page-list/edit.js.map +1 -1
- package/build-style/common-rtl.css +3 -1
- package/build-style/common.css +3 -1
- package/build-style/cover/style-rtl.css +2 -1
- package/build-style/cover/style.css +2 -1
- package/build-style/editor-rtl.css +1 -0
- package/build-style/editor.css +1 -0
- package/build-style/gallery/style-rtl.css +4 -2
- package/build-style/gallery/style.css +4 -2
- package/build-style/style-rtl.css +16 -5
- package/build-style/style.css +16 -5
- package/build-style/table/editor-rtl.css +1 -0
- package/build-style/table/editor.css +1 -0
- package/build-style/table/style-rtl.css +5 -0
- package/build-style/table/style.css +5 -0
- package/build-style/table/theme-rtl.css +0 -2
- package/build-style/table/theme.css +0 -2
- package/build-style/theme-rtl.css +0 -2
- package/build-style/theme.css +0 -2
- package/build-style/video/style-rtl.css +2 -1
- package/build-style/video/style.css +2 -1
- package/package.json +6 -6
- package/src/cover/edit/index.js +3 -1
- package/src/list/utils.js +3 -11
- package/src/list-item/edit.js +1 -0
- package/src/page-list/edit.js +36 -22
- package/src/post-featured-image/index.php +17 -18
- package/src/table/editor.scss +1 -0
- package/src/table/style.scss +7 -0
- package/src/table/theme.scss +0 -2
- package/src/template-part/index.php +5 -0
|
@@ -19,6 +19,12 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
19
19
|
}
|
|
20
20
|
$post_ID = $block->context['postId'];
|
|
21
21
|
|
|
22
|
+
// Check is needed for backward compatibility with third-party plugins
|
|
23
|
+
// that might rely on the `in_the_loop` check; calling `the_post` sets it to true.
|
|
24
|
+
if ( ! in_the_loop() && have_posts() ) {
|
|
25
|
+
the_post();
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
$is_link = isset( $attributes['isLink'] ) && $attributes['isLink'];
|
|
23
29
|
$size_slug = isset( $attributes['sizeSlug'] ) ? $attributes['sizeSlug'] : 'post-thumbnail';
|
|
24
30
|
$post_title = trim( strip_tags( get_the_title( $post_ID ) ) );
|
|
@@ -29,11 +35,18 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
29
35
|
$attr['alt'] = $post_title;
|
|
30
36
|
}
|
|
31
37
|
|
|
38
|
+
if ( ! empty( $attributes['height'] ) ) {
|
|
39
|
+
$extra_styles = "height:{$attributes['height']};";
|
|
40
|
+
if ( ! empty( $attributes['scale'] ) ) {
|
|
41
|
+
$extra_styles .= "object-fit:{$attributes['scale']};";
|
|
42
|
+
}
|
|
43
|
+
$attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
|
|
44
|
+
}
|
|
45
|
+
|
|
32
46
|
$featured_image = get_the_post_thumbnail( $post_ID, $size_slug, $attr );
|
|
33
47
|
if ( ! $featured_image ) {
|
|
34
48
|
return '';
|
|
35
49
|
}
|
|
36
|
-
$wrapper_attributes = get_block_wrapper_attributes();
|
|
37
50
|
if ( $is_link ) {
|
|
38
51
|
$link_target = $attributes['linkTarget'];
|
|
39
52
|
$rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : '';
|
|
@@ -49,23 +62,9 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
49
62
|
$featured_image = $featured_image . $overlay_markup;
|
|
50
63
|
}
|
|
51
64
|
|
|
52
|
-
$
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if ( $has_width ) {
|
|
59
|
-
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if ( $has_height ) {
|
|
63
|
-
$image_styles = "height:{$attributes['height']};";
|
|
64
|
-
if ( ! empty( $attributes['scale'] ) ) {
|
|
65
|
-
$image_styles .= "object-fit:{$attributes['scale']};";
|
|
66
|
-
}
|
|
67
|
-
$featured_image = str_replace( '<img ', '<img style="' . esc_attr( safecss_filter_attr( $image_styles ) ) . '" ', $featured_image );
|
|
68
|
-
}
|
|
65
|
+
$wrapper_attributes = empty( $attributes['width'] )
|
|
66
|
+
? get_block_wrapper_attributes()
|
|
67
|
+
: get_block_wrapper_attributes( array( 'style' => "width:{$attributes['width']};" ) );
|
|
69
68
|
|
|
70
69
|
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
71
70
|
}
|
package/src/table/editor.scss
CHANGED
package/src/table/style.scss
CHANGED
package/src/table/theme.scss
CHANGED
|
@@ -193,6 +193,11 @@ function build_template_part_block_instance_variations() {
|
|
|
193
193
|
if ( wp_installing() ) {
|
|
194
194
|
return array();
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
if ( ! current_theme_supports( 'block-templates' ) && ! current_theme_supports( 'block-template-parts' ) ) {
|
|
198
|
+
return array();
|
|
199
|
+
}
|
|
200
|
+
|
|
196
201
|
$variations = array();
|
|
197
202
|
$template_parts = get_block_templates(
|
|
198
203
|
array(
|