Changeset 56159 for trunk/src/wp-includes/blocks/post-title.php
- Timestamp:
- 07/07/2023 07:18:46 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/post-title.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-title.php
r56065 r56159 20 20 } 21 21 22 $post = get_post( $block->context['postId'] ); 23 $title = get_the_title( $post ); 22 /** 23 * The `$post` argument is intentionally omitted so that changes are reflected when previewing a post. 24 * See: https://github.com/WordPress/gutenberg/pull/37622#issuecomment-1000932816. 25 */ 26 $title = get_the_title(); 24 27 25 28 if ( ! $title ) { … … 34 37 if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { 35 38 $rel = ! empty( $attributes['rel'] ) ? 'rel="' . esc_attr( $attributes['rel'] ) . '"' : ''; 36 $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $ post), esc_attr( $attributes['linkTarget'] ), $rel, $title );39 $title = sprintf( '<a href="%1$s" target="%2$s" %3$s>%4$s</a>', get_the_permalink( $block->context['postId'] ), esc_attr( $attributes['linkTarget'] ), $rel, $title ); 37 40 } 38 41
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)