Make WordPress Core


Ignore:
Timestamp:
09/15/2022 12:18:30 PM (3 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/src/wp-includes/functions.php

    r54157 r54176  
    52625262
    52635263    $menu_name = __( 'Widgets' );
    5264     if ( wp_is_block_theme() ) {
     5264    if ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) {
    52655265        $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
    52665266    } else {
Note: See TracChangeset for help on using the changeset viewer.