Changeset 52042 for trunk/src/wp-includes/blocks/post-title.php
- Timestamp:
- 11/08/2021 02:26:27 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-title.php
r50929 r52042 20 20 } 21 21 22 $post_ID = $block->context['postId']; 22 $post_ID = $block->context['postId']; 23 $title = get_the_title( $post_ID ); 24 25 if ( ! $title ) { 26 return ''; 27 } 28 23 29 $tag_name = 'h2'; 24 30 $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; … … 28 34 } 29 35 30 $title = get_the_title( $post_ID );31 36 if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { 32 $title = sprintf( '<a href="%1 s" target="%2s" rel="%3s">%4s</a>', get_the_permalink( $post_ID ), $attributes['linkTarget'], $attributes['rel'], $title );37 $title = sprintf( '<a href="%1$s" target="%2$s" rel="%3$s">%4$s</a>', get_the_permalink( $post_ID ), $attributes['linkTarget'], $attributes['rel'], $title ); 33 38 } 34 39 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
Note: See TracChangeset
for help on using the changeset viewer.