Skip to content
Prev Previous commit
Next Next commit
Make sure to not override meta and tax input
  • Loading branch information
ellatrix committed Oct 21, 2025
commit ec3dfd72e7e991648d8f34ab5d9e6ad2f48e6630
14 changes: 8 additions & 6 deletions src/wp-includes/block-template-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1859,14 +1859,16 @@ function wp_assign_new_template_to_theme( $changes, $request ) {
if ( $template ) {
return $changes;
}
$changes->tax_input = array(
'wp_theme' => isset( $request['theme'] ) ? $request['theme'] : get_stylesheet(),
);
if ( ! isset( $changes->tax_input ) ) {
$changes->tax_input = array();
}
$changes->tax_input['wp_theme'] = isset( $request['theme'] ) ? $request['theme'] : get_stylesheet();
// All new templates saved will receive meta so we can distinguish between
// templates created the old way as edits and templates created the new way.
$changes->meta_input = array(
'is_inactive_by_default' => true,
);
if ( ! isset( $changes->meta_input ) ) {
$changes->meta_input = array();
}
$changes->meta_input['is_inactive_by_default'] = true;
return $changes;
}

Expand Down