[wp-trac] [WordPress Trac] #40722: Customize: The starter content fresh_site flag is not successfully cleared when editing widgets on admin screen
WordPress Trac
noreply at wordpress.org
Wed May 10 20:55:40 UTC 2017
#40722: Customize: The starter content fresh_site flag is not successfully cleared
when editing widgets on admin screen
--------------------------+-----------------
Reporter: westonruter | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.8
Component: Customize | Version: 4.7
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------
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
<?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
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40722>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list