Make WordPress Core


Ignore:
Timestamp:
11/25/2021 10:57:19 AM (2 years ago)
Author:
youknowriad
Message:

Themes: Update the base folders for templates and template parts in block themes.

Block Themes should now use the following folders:

  • templates instead of block-templates
  • parts instead of block-template-parts

Existing themes and folders will continue to work without impact.

Props bernhard-reiter.
Fixes #54493.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/block-template.php

    r52246 r52247  
    3838        $resolved_template_path = locate_block_template( get_stylesheet_directory() . '/page-home.php', $type, $templates );
    3939        $this->assertEquals( self::$template_canvas_path, $resolved_template_path );
    40         $this->assertStringEqualsFile( get_stylesheet_directory() . '/block-templates/page-home.html', $_wp_current_template_content );
     40        $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/page-home.html', $_wp_current_template_content );
    4141    }
    4242
     
    5151        $resolved_template_path = locate_block_template( get_stylesheet_directory() . '/page.php', $type, $templates );
    5252        $this->assertEquals( self::$template_canvas_path, $resolved_template_path );
    53         $this->assertStringEqualsFile( get_stylesheet_directory() . '/block-templates/page.html', $_wp_current_template_content );
     53        $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/page.html', $_wp_current_template_content );
    5454    }
    5555
     
    6262        $resolved_template_path = locate_block_template( get_stylesheet_directory() . '/index.php', $type, $templates );
    6363        $this->assertEquals( self::$template_canvas_path, $resolved_template_path );
    64         $this->assertStringEqualsFile( get_stylesheet_directory() . '/block-templates/index.html', $_wp_current_template_content );
     64        $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/index.html', $_wp_current_template_content );
    6565    }
    6666
     
    129129        $resolved_template_path          = locate_block_template( $parent_theme_page_template_path, $type, $templates );
    130130        $this->assertEquals( self::$template_canvas_path, $resolved_template_path );
    131         $this->assertStringEqualsFile( get_stylesheet_directory() . '/block-templates/page-1.html', $_wp_current_template_content );
     131        $this->assertStringEqualsFile( get_stylesheet_directory() . '/templates/page-1.html', $_wp_current_template_content );
    132132    }
    133133
Note: See TracChangeset for help on using the changeset viewer.