Changeset 56065 for trunk/src/wp-includes/blocks/post-title.php
- Timestamp:
- 06/27/2023 02:20:18 PM (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
r55246 r56065 20 20 } 21 21 22 $post _ID = $block->context['postId'];23 $title = get_the_title();22 $post = get_post( $block->context['postId'] ); 23 $title = get_the_title( $post ); 24 24 25 25 if ( ! $title ) { … … 29 29 $tag_name = 'h2'; 30 30 if ( isset( $attributes['level'] ) ) { 31 $tag_name = 0 === $attributes['level'] ? 'p' :'h' . $attributes['level'];31 $tag_name = 'h' . $attributes['level']; 32 32 } 33 33 34 34 if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { 35 35 $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 _ID), esc_attr( $attributes['linkTarget'] ), $rel, $title );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 ); 37 37 } 38 38
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)