[wp-trac] [WordPress Trac] #33467: Widgets that display to non logged-in users only NOT editable in customizer

WordPress Trac noreply at wordpress.org
Thu Aug 20 20:19:09 UTC 2015


#33467: Widgets that display to non logged-in users only NOT editable in customizer
-------------------------------+------------------------------
 Reporter:  lisaleague         |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Customize          |     Version:  3.9
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by westonruter):

 OK, so you're talking about an entire widget _area_ (sidebar) only being
 displayed to non-authenticated visitors? Do you have such an “Anonymous
 User” sidebar? I thought you were referring to one specific widget. This
 being the case, the reason why the sidebar is not being displayed is
 because the Customizer thinks that the sidebar doesn't belong on the
 current template (which it doesn't, because you are logged-in), and so it
 hides it from being displayed.

 Does your theme template code have something like this:

 {{{
 if ( ! is_user_logged_in() ) {
     dynamic_sidebar( 'anonymous-visitors' );
 }
 }}}

 If so, then you can quickly resolve your problem by changing this to:

 {{{
 if ( ! is_user_logged_in() || is_customize_preview() ) {
     dynamic_sidebar( 'anonymous-visitors' );
 }
 }}}

 This will ensure the sidebar can be managed in the Customizer.

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


More information about the wp-trac mailing list