Opened 8 years ago
Closed 8 years ago
#40722 closed defect (bug) (fixed)
Customize: The starter content fresh_site flag is not successfully cleared when editing widgets on admin screen
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | Customize | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
After a fresh install, if you go to the widgets admin screen and make changes to widgets and sidebars, and then go into the Customizer you'll see that starter content from Twenty Seventeen overrides the changes you made on the admin screen. In other words, changes to widgets on the admin screen are not successfully clearing the fresh_site
flag.
In the following logic in default-filters.php
:
<?php // Mark site as no longer fresh foreach ( array( 'publish_post', 'publish_page', 'wp_ajax_save-widget', 'wp_ajax_widgets-order', 'customize_save_after' ) as $action ) { add_action( $action, '_delete_option_fresh_site' ); }
The action is added at the default priority of 10
. This is problematic for the wp_ajax_save-widget
and wp_ajax_widgets-order
actions specifically because in admin-ajax.php
, it adds action handlers to happen at priority 1
. The net result is that _delete_option_fresh_site
never gets called for these actions because Ajax handlers die
when they complete. The solution then is to change the priority to be 0
.
See:
https://wordpress.slack.com/archives/C0381N237/p1494419740017818
https://github.com/xwp/wp-core-media-widgets/issues/169
In 40608: