[wp-trac] [WordPress Trac] #30677: Customizer: Setting Front page does not work

WordPress Trac noreply at wordpress.org
Wed Dec 17 09:49:35 UTC 2014


#30677: Customizer: Setting Front page does not work
-------------------------+-----------------------------
 Reporter:  pavelevap    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Future Release
Component:  Customize    |     Version:  3.4
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |     Focuses:  javascript
-------------------------+-----------------------------
Changes (by westonruter):

 * keywords:  has-patch 2nd-opinion => needs-patch
 * focuses:   => javascript


Comment:

 The front page control could also just have a notice which alerts them
 when they are not on the homepage.

 > ⚠ This setting can only be previewed on the __front page__.

 And clicking the “front page” link would then navigate the user to the
 homepage where the setting would be applied if it was changed, or they
 could then make the change to see it apply. When navigating to the
 homepage, the notice could `slideUp`, and when navigating away from the
 homepage it could `slideDown`. In terms of how to implement, we can simply
 enqueue some JS in the Customizer preview which does essentially:

 {{{#!js
 wp.customize.preview.send( 'isFrontPage', <?php echo wp_json_encode(
 is_front_page() ) ?> );
 }}}

 The static frontpage control would then listen for `isFrontPage` messages
 and toggle the visibility according to its boolean value.

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


More information about the wp-trac mailing list