Skip to content

Commit e7edcbc

Browse files
committed
Make sure to not override meta and tax input
1 parent cde4cc9 commit e7edcbc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/wp-includes/block-template-utils.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,14 +1859,16 @@ function wp_assign_new_template_to_theme( $changes, $request ) {
18591859
if ( $template ) {
18601860
return $changes;
18611861
}
1862-
$changes->tax_input = array(
1863-
'wp_theme' => isset( $request['theme'] ) ? $request['theme'] : get_stylesheet(),
1864-
);
1862+
if ( ! isset( $changes->tax_input ) ) {
1863+
$changes->tax_input = array();
1864+
}
1865+
$changes->tax_input['wp_theme'] = isset( $request['theme'] ) ? $request['theme'] : get_stylesheet();
18651866
// All new templates saved will receive meta so we can distinguish between
18661867
// templates created the old way as edits and templates created the new way.
1867-
$changes->meta_input = array(
1868-
'is_inactive_by_default' => true,
1869-
);
1868+
if ( ! isset( $changes->meta_input ) ) {
1869+
$changes->meta_input = array();
1870+
}
1871+
$changes->meta_input['is_inactive_by_default'] = true;
18701872
return $changes;
18711873
}
18721874

0 commit comments

Comments
 (0)