[wp-trac] [WordPress Trac] #39950: window is reloaded after changing page_for_posts in Customizer even with transport->postMessage

WordPress Trac noreply at wordpress.org
Thu Feb 23 17:37:57 UTC 2017


#39950: window is reloaded after changing page_for_posts in Customizer even with
transport->postMessage
---------------------------+------------------------------
 Reporter:  martinmalinda  |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Customize      |     Version:  4.7.2
 Severity:  normal         |  Resolution:
 Keywords:  close          |     Focuses:  ui, javascript
---------------------------+------------------------------
Changes (by westonruter):

 * keywords:   => close


Comment:

 Actually, the preview isn't refreshing, but rather it is changing the URL
 to the page you just switched to. This is intentional. See this snippet in
 `customize-controls.js`:

 {{{#!js
 // Change the previewed URL to the selected page when changing the
 page_for_posts.
 api( 'page_for_posts', function( setting ) {
         setting.bind(function( pageId ) {
                 pageId = parseInt( pageId, 10 );
                 if ( pageId > 0 ) {
                         api.previewer.previewUrl.set(
 api.settings.url.home + '?page_id=' + pageId );
                 }
         });
 });
 }}}

 This behavior was introduced in #30677.

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


More information about the wp-trac mailing list