Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backport-changelog/6.9/8063.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ https://github.com/WordPress/wordpress-develop/pull/8063
* https://github.com/WordPress/gutenberg/pull/72141
* https://github.com/WordPress/gutenberg/pull/72223
* https://github.com/WordPress/gutenberg/pull/72285
* https://github.com/WordPress/gutenberg/pull/72700
* https://github.com/WordPress/gutenberg/pull/72674
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Gutenberg_REST_Static_Templates_Controller extends WP_REST_Templates_Controller {
public function __construct() {
$this->rest_base = 'wp_registered_template';
$this->rest_base = 'registered-templates';
$this->namespace = 'wp/v2';
}

Expand Down
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.9/template-activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
add_filter( 'register_post_type_args', 'gutenberg_modify_wp_template_post_type_args', 10, 2 );
function gutenberg_modify_wp_template_post_type_args( $args, $post_type ) {
if ( 'wp_template' === $post_type ) {
$args['rest_base'] = 'wp_template';
$args['rest_base'] = 'created-templates';
$args['rest_controller_class'] = 'WP_REST_Posts_Controller';
$args['autosave_rest_controller_class'] = null;
$args['revisions_rest_controller_class'] = null;
Expand Down Expand Up @@ -61,7 +61,7 @@ function gutenberg_maintain_templates_routes() {
$wp_post_types['wp_template']->autosave_rest_controller_class = $original_autosave_rest_controller_class;
$wp_post_types['wp_template']->revisions_rest_controller_class = $original_revisions_rest_controller_class;
// Restore the original base.
$wp_post_types['wp_template']->rest_base = 'wp_template';
$wp_post_types['wp_template']->rest_base = 'created-templates';

// Register the old routes.
$autosaves_controller->register_routes();
Expand Down
2 changes: 1 addition & 1 deletion packages/core-data/src/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export const rootEntitiesConfig = [
label: __( 'Registered Templates' ),
name: 'registeredTemplate',
kind: 'root',
baseURL: '/wp/v2/wp_registered_template',
baseURL: '/wp/v2/registered-templates',
key: 'id',
},
];
Expand Down
Loading