Skip to content

Commit

Permalink
Fix broken template revert
Browse files Browse the repository at this point in the history
  • Loading branch information
Aljullu committed May 14, 2024
1 parent eb6f5e7 commit 89a3927
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function update_item( $request ) {
wp_delete_post( $template->wp_id, true );
$request->set_param( 'context', 'edit' );

$template = get_block_template( $request['id'], $this->post_type );
$template = gutenberg_get_block_template( $request['id'], $this->post_type );
$response = $this->prepare_item_for_response( $template, $request );

return rest_ensure_response( $response );
Expand Down Expand Up @@ -534,7 +534,7 @@ private static function get_wp_templates_author_text_field( $template_object ) {
case 'plugin':
$plugins = get_plugins();
$plugin_name = isset( $template_object->plugin ) ? $template_object->plugin . '/' . $template_object->plugin : $template_object->theme;
$plugin = $plugins[ plugin_basename( sanitize_text_field( $plugin_name . '.php' ) ) ];
$plugin = $plugins[ plugin_basename( sanitize_text_field( $plugin_name . '.php' ) ) ];
return empty( $plugin['Name'] ) ? $template_object->theme : $plugin['Name'];
case 'site':
return get_bloginfo( 'name' );
Expand Down

0 comments on commit 89a3927

Please sign in to comment.