[wp-trac] [WordPress Trac] #39221: Customize: Prevent setting previewing logic when settings will be saved

WordPress Trac noreply at wordpress.org
Sat Dec 10 06:36:41 UTC 2016


#39221: Customize: Prevent setting previewing logic when settings will be saved
-------------------------+-----------------
 Reporter:  westonruter  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  4.8
Component:  Customize    |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------
 When a setting is previewed this may very well cause a save to fail
 because WP may detect that the value is already set in the database (as in
 the case of options) and thus no-op. Or in the case of deleting a nav menu
 in the customizer, the preview filter causes the nav menu object to fail
 to be returned if the preview filter is applied (see #39103).

 The way this has been accounted for in core up until now is to prevent
 calling `WP_Customize_Setting::preview()` when a `customize_save` admin
 ajax request is being done. This is not ideal, however, as it is too
 closely bound to the existing customize.php app and is not generic enough
 for other applications which may be built for live preview, such as REST
 API (#38900), although to be sure it is unlikely that the customizer
 preview logic would be booted when manipulating a `changeset` endpoint.

 See https://core.trac.wordpress.org/attachment/ticket/39103/39103.1.dff
 for one possible approach, where a non-previewing `WP_Customize_Manager`
 instance could be made.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39221>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list