Skip to content

Commit

Permalink
Remove unnecessary the_ prefix, in accordance with WordPress/gutenber…
Browse files Browse the repository at this point in the history
  • Loading branch information
felixarntz committed Jan 27, 2023
1 parent 6230509 commit 9597731
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/block-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ function get_the_block_template_html() {
$content = wptexturize( $content );
$content = convert_smilies( $content );
$content = shortcode_unautop( $content );
$content = wp_filter_content_tags( $content, 'the_template' );
$content = wp_filter_content_tags( $content, 'template' );
$content = do_shortcode( $content );
$content = str_replace( ']]>', ']]>', $content );

Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/blocks/template-part.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function render_block_core_template_part( $attributes ) {
$content = wptexturize( $content );
$content = convert_smilies( $content );
$content = shortcode_unautop( $content );
$content = wp_filter_content_tags( $content, "the_template_part_{$area}" );
$content = wp_filter_content_tags( $content, "template_part_{$area}" );
$content = do_shortcode( $content );

// Handle embeds for block template parts.
Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -5433,13 +5433,13 @@ function wp_get_webp_info( $filename ) {
*/
function wp_get_loading_attr_default( $context ) {
// Skip lazy-loading for the overall block template, as it is handled more granularly.
if ( 'the_template' === $context ) {
if ( 'template' === $context ) {
return false;
}

// Do not lazy-load images in the header block template part, as they are likely above the fold.
$header_area = WP_TEMPLATE_PART_AREA_HEADER;
if ( "the_template_part_{$header_area}" === $context ) {
if ( "template_part_{$header_area}" === $context ) {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/phpunit/tests/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -3516,8 +3516,8 @@ public function test_wp_get_loading_attr_default( $context ) {
}

// Exceptions: In the following contexts, images shouldn't be lazy-loaded by default.
$this->assertFalse( wp_get_loading_attr_default( 'the_template' ) );
$this->assertFalse( wp_get_loading_attr_default( 'the_template_part_' . WP_TEMPLATE_PART_AREA_HEADER ) );
$this->assertFalse( wp_get_loading_attr_default( 'template' ) );
$this->assertFalse( wp_get_loading_attr_default( 'template_part_' . WP_TEMPLATE_PART_AREA_HEADER ) );
}

public function data_wp_get_loading_attr_default() {
Expand Down

0 comments on commit 9597731

Please sign in to comment.