mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Editor: Preserve the original template keys when preparing a list of page templates.
Previously, the original "404" template key was lost when "Default template" is merged into the available templates array, as the `array_merge()` function renumbers numeric keys. Later, when we merge templates on the client side, this caused duplicate "404" templates to appear in the dropdown. By replacing the `array_merge()` call with `array_replace()`, we make sure to keep the original numeric keys. Props Mamaduka, Toro_Unit, youknowriad. Fixes #53898. Built from https://develop.svn.wordpress.org/trunk@51595 git-svn-id: http://core.svn.wordpress.org/trunk@51206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
74bef46884
commit
78e8a3db65
@ -119,7 +119,7 @@ wp_add_inline_script(
|
||||
* besides the default value.
|
||||
*/
|
||||
$available_templates = wp_get_theme()->get_page_templates( get_post( $post->ID ) );
|
||||
$available_templates = ! empty( $available_templates ) ? array_merge(
|
||||
$available_templates = ! empty( $available_templates ) ? array_replace(
|
||||
array(
|
||||
/** This filter is documented in wp-admin/includes/meta-boxes.php */
|
||||
'' => apply_filters( 'default_page_template_title', __( 'Default template' ), 'rest-api' ),
|
||||
|
@ -13,7 +13,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51594';
|
||||
$wp_version = '5.9-alpha-51595';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user