Make WordPress Core

Changeset 52336


Ignore:
Timestamp:
12/07/2021 04:38:47 PM (3 years ago)
Author:
youknowriad
Message:

Site Editor: Render the template descriptions properly.

The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/site-editor.php

    r52333 r52336  
    3838);
    3939
     40$indexed_template_types = array();
     41foreach ( get_default_block_template_types() as $slug => $template_type ) {
     42    $template_type['slug']    = (string) $slug;
     43    $indexed_template_types[] = $template_type;
     44}
     45
    4046$block_editor_context = new WP_Block_Editor_Context();
    4147$custom_settings      = array(
     
    4349    'postsPerPage'                         => get_option( 'posts_per_page' ),
    4450    'styles'                               => get_block_editor_theme_styles(),
    45     'defaultTemplateTypes'                 => get_default_block_template_types(),
     51    'defaultTemplateTypes'                 => $indexed_template_types,
    4652    'defaultTemplatePartAreas'             => get_allowed_block_template_part_areas(),
    4753    '__experimentalBlockPatterns'          => WP_Block_Patterns_Registry::get_instance()->get_all_registered(),
Note: See TracChangeset for help on using the changeset viewer.