Skip to content

Commit

Permalink
Remove obsolete code
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 21, 2024
1 parent a42896d commit c0f6900
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php

class Gutenberg_REST_Static_Templates_Controller extends Gutenberg_REST_Templates_Controller_6_7 {
public function __construct( $post_type ) {
parent::__construct( $post_type );
}

public function register_routes() {
// Lists all templates.
register_rest_route(
Expand Down
19 changes: 0 additions & 19 deletions lib/compat/wordpress-6.8/template-activate.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,6 @@ function gutenberg_tax_get_block_templates( $output, $query, $template_type ) {
return $output;
}

// Bypass the terms check in _build_block_template_result_from_post.
add_filter( 'get_the_terms', 'gutenberg_get_the_terms', 10, 3 );
function gutenberg_get_the_terms( $terms, $object_id, $taxonomy ) {
if ( 'wp_theme' === $taxonomy ) {
$stylesheet = get_stylesheet();
return array(
new WP_Term(
(object) array(
'term_id' => 0,
'name' => $stylesheet,
'slug' => $stylesheet,
'taxonomy' => 'wp_theme',
)
),
);
}
return $terms;
}

// We need to set the theme for the template when it's created. See:
// https://github.com/WordPress/wordpress-develop/blob/b2c8d8d2c8754cab5286b06efb4c11e2b6aa92d5/src/wp-includes/rest-api/endpoints/class-wp-rest-templates-controller.php#L571-L578
add_action( 'rest_pre_insert_wp_template', 'gutenberg_set_active_template_theme', 10, 2 );
Expand Down
1 change: 0 additions & 1 deletion test/e2e/specs/site-editor/template-registration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ test.describe( 'Block template registration', () => {
page,
blockTemplateRegistrationUtils,
} ) => {
// Create a post.
await admin.createNewPost();
await editor.insertBlock( {
name: 'core/paragraph',
Expand Down

0 comments on commit c0f6900

Please sign in to comment.