From 016a3f9ecd8d9c1d1053a39600671167f30cef14 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 10 Nov 2017 22:44:52 +0000 Subject: [PATCH] Customize: Ensure customization drafts are published instead of trashed when scheduled changeset goes live while non-admin user is authenticated (such as during WP Cron). Props designsimply for testing, dlh for testing, melchoyce for testing. See #28721, #34923, #42220. Fixes #42489 for trunk. Built from https://develop.svn.wordpress.org/trunk@42148 git-svn-id: http://core.svn.wordpress.org/trunk@41979 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-customize-nav-menus.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index d178de3e24..9540f65836 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -49,6 +49,7 @@ final class WP_Customize_Nav_Menus { add_action( 'customize_register', array( $this, 'customize_register' ), 11 ); add_filter( 'customize_dynamic_setting_args', array( $this, 'filter_dynamic_setting_args' ), 10, 2 ); add_filter( 'customize_dynamic_setting_class', array( $this, 'filter_dynamic_setting_class' ), 10, 3 ); + add_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) ); // Skip remaining hooks when the user can't manage nav menus anyway. if ( ! current_user_can( 'edit_theme_options' ) ) { @@ -64,7 +65,6 @@ final class WP_Customize_Nav_Menus { add_action( 'customize_controls_print_footer_scripts', array( $this, 'available_items_template' ) ); add_action( 'customize_preview_init', array( $this, 'customize_preview_init' ) ); add_action( 'customize_preview_init', array( $this, 'make_auto_draft_status_previewable' ) ); - add_action( 'customize_save_nav_menus_created_posts', array( $this, 'save_nav_menus_created_posts' ) ); // Selective Refresh partials. add_filter( 'customize_dynamic_partial_args', array( $this, 'customize_dynamic_partial_args' ), 10, 2 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1789e84116..bbb5b9f154 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-alpha-42146'; +$wp_version = '5.0-alpha-42148'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.