PluginProbe
Gutenberg / 10.1.0
Gutenberg v10.1.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
← All changes | build/block-library/blocks/post-title.php +3 -8 12.6.0 → 10.1.0 View file →
@@ -18,15 +18,9 @@
18 18 if ( ! isset( $block->context['postId'] ) ) {
19 19 return '';
20 20 }
21 21
22 - $post_ID = $block->context['postId'];
23 - $title = get_the_title();
24 -
25 - if ( ! $title ) {
26 - return '';
27 - }
28 -
22 + $post_ID = $block->context['postId'];
29 23 $tag_name = 'h2';
30 24 $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
31 25
32 26 if ( isset( $attributes['level'] ) ) {
@@ -32,10 +26,11 @@
32 26 if ( isset( $attributes['level'] ) ) {
33 27 $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level'];
34 28 }
35 29
30 + $title = get_the_title( $post_ID );
36 31 if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
37 - $title = sprintf( '<a href="%1$s" target="%2$s" rel="%3$s">%4$s</a>', get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), esc_attr( $attributes['rel'] ), $title );
32 + $title = sprintf( '<a href="%1s" target="%2s" rel="%3s">%4s</a>', get_the_permalink( $post_ID ), $attributes['linkTarget'], $attributes['rel'], $title );
38 33 }
39 34 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
40 35
41 36 return sprintf(