Make WordPress Core


Ignore:
Timestamp:
09/20/2024 02:05:50 AM (8 months ago)
Author:
noisysocks
Message:

Editor: Add plugin template registration API and improve theme overrides for plugin-registered templates

This commit introduces a new API to allow plugins to easily register block
templates with wp_register_block_template() and the
WP_Block_Templates_Registry class, addressing the complexity of hooking into
multiple filters. It also ensures plugin-registered templates overridden by
themes fall back to the plugin-provided title and description when the theme
doesn't define them.

See https://github.com/WordPress/gutenberg/pull/61577.
See https://github.com/WordPress/gutenberg/pull/64610.

Fixes #61804.
Props aljullu, peterwilsoncc, antonvlasenko, azaozz, youknowriad, noisysocks.

File:
1 edited

Legend:

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

    r57710 r59073  
    311311        $properties = $data['schema']['properties'];
    312312
    313         $this->assertCount( 18, $properties );
     313        $this->assertCount( 19, $properties );
    314314        $this->assertArrayHasKey( 'id', $properties, 'ID key should exist in properties.' );
    315315        $this->assertArrayHasKey( 'slug', $properties, 'Slug key should exist in properties.' );
     
    329329        $this->assertArrayHasKey( 'author_text', $properties, 'author_text key should exist in properties.' );
    330330        $this->assertArrayHasKey( 'original_source', $properties, 'original_source key should exist in properties.' );
     331        $this->assertArrayHasKey( 'plugin', $properties, 'plugin key should exist in properties.' );
    331332    }
    332333
Note: See TracChangeset for help on using the changeset viewer.