Make WordPress Core


Ignore:
Timestamp:
09/15/2022 12:18:30 PM (2 years ago)
Author:
hellofromTonya
Message:

Themes: Introduces block-based template parts for Classic themes.

Allows Classic / Hybrid themes to use block-based template parts without using complete block-based templates.

  • Exposes the Site Editor's template parts UI
  • Adds Appearance > "Template Parts" menu
  • Enabled within the theme via adding a theme support for 'block-template-parts'
    add_theme_support( 'block-template-parts' );
    

This is a backport from Gutenberg.See WordPress/gutenberg PR 42729.

Follow-up to [52330], [52069], [52178].

Props mamaduka, fabiankaegy, poena, scruffian, manfcarlo, bernhard-reiter, hellofromTonya.
See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php

    r54162 r54176  
    389389        $this->assertArrayHasKey( 'automatic-feed-links', $theme_supports );
    390390        $this->assertArrayHasKey( 'block-templates', $theme_supports );
     391        $this->assertArrayHasKey( 'block-template-parts', $theme_supports, "Theme supports should have 'block-template-parts' key" );
    391392        $this->assertArrayHasKey( 'custom-header', $theme_supports );
    392393        $this->assertArrayHasKey( 'custom-background', $theme_supports );
     
    408409        $this->assertArrayHasKey( 'title-tag', $theme_supports );
    409410        $this->assertArrayHasKey( 'wp-block-styles', $theme_supports );
    410         $this->assertCount( 22, $theme_supports );
     411        $this->assertCount( 23, $theme_supports, 'There should be 23 theme supports' );
    411412    }
    412413
Note: See TracChangeset for help on using the changeset viewer.