[wp-trac] [WordPress Trac] #62755: Allow template duplication + concept of active templates

WordPress Trac noreply at wordpress.org
Tue Oct 21 13:40:46 UTC 2025


#62755: Allow template duplication + concept of active templates
-----------------------------+-----------------------
 Reporter:  ellatrix         |       Owner:  ellatrix
     Type:  enhancement      |      Status:  closed
 Priority:  normal           |   Milestone:  6.9
Component:  Editor           |     Version:  trunk
 Severity:  normal           |  Resolution:  fixed
 Keywords:  gutenberg-merge  |     Focuses:
-----------------------------+-----------------------
Changes (by ellatrix):

 * owner:  (none) => ellatrix
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"61029" 61029]:
 {{{
 #!CommitTicketReference repository="" revision="61029"
 Templates: add PHP changes required for the template activation feature.

 * Adds the `active_templates` setting, which is an object holding the
 template slug as a key and template post ID as the value.
 * To maintain backwards compatibility, any `wp_template` (post type) not
 created through the new API will be activated.
 * `get_block_template` and `get_block_templates` have been adjusted to
 check `active_templates`. These functions should never return inactive
 templates, just like before, to maintain backwards compatibility.
 * The pre-existing `/templates` endpoint and sub-endpoints remain and work
 exactly as before.
 * A new endpoint `/wp_template` has been added, but this is just a regular
 posts controller (`WP_REST_Posts_Controller`). We do register an
 additional `theme` field and expose the `is_wp_suggestion` meta.
 * Another new endpoint `/wp_registered_template` has been added, which is
 read-only and lists the registered templates from themes and plugin (un-
 edited, without activations applied).

 These changes are to be iterated on.

 See https://github.com/WordPress/wordpress-develop/pull/8063.

 Props ellatrix, shailu25, ntsekouras.
 Fixes #62755.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62755#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list