[wp-trac] [WordPress Trac] #42457: Scheduled changeset won't publish if Customizer is opened first after missing schedule

WordPress Trac noreply at wordpress.org
Wed Nov 8 04:07:20 UTC 2017


#42457: Scheduled changeset won't publish if Customizer is opened first after
missing schedule
----------------------------+------------------
 Reporter:  LittleBigThing  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  4.9
Component:  Customize       |     Version:  4.9
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |     Focuses:
----------------------------+------------------

Comment (by dlh):

 I can't think of anything more straightforward than an Ajax request so
 far, especially at this point in the 4.9 cycle.

 The only alternative I can think of, although I'm not really sold on it,
 is to take advantage of the fact that the changeset post ID is available
 before each setting's `preview()` method is called here:
 https://github.com/WordPress/wordpress-
 develop/blob/9f77ec13ffcf1ab14c8699fdb68e728709eb6bb5/src/wp-includes
 /class-wp-customize-manager.php#L923.

 Because the manager knows the changeset ID, it could perform the same
 "missed schedule" logic that's in `customize.php` and skip calling
 `preview()` if the changeset has missed the schedule, or even call
 `wp_publish_post()` itself.

 But, apart from being more code than the Ajax request, that approach seems
 like it would conflict with the idea behind the `settings_previewed`
 argument to begin with.

 Thinking out loud a bit, maybe in the future `WP_Customize_Manager` (or
 `WP_Customize_Changeset`) could have a "missed schedule" property that
 `_wp_customize_include()` could use to switch
 `WP_Customize_Manager::$settings_previewed` as needed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42457#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list