[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:27:32 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:                |     Focuses:
--------------------------+------------------------------
Changes (by lisaleague):

 * keywords:  reporter-feedback =>


Comment:

 Nope, I con't have a conditional like that - just
 {{{
 if ( ! is_user_logged_in() ) {
 }}}

 I have -

 {{{
 genesis_register_sidebar( array(
         'id'          => 'sticky-message',
         'name'        => __( 'Sticky Message', 'bg-mobile-first' ),
         'description' => __( 'This is the sticky message widget area.',
 'bg-mobile-first' ),
 ) );

 add_action( 'genesis_before', 'mobile_first_sticky_message' );
 function mobile_first_sticky_message() {
         if ( ! is_user_logged_in() ) {
                 genesis_widget_area( 'sticky-message', array(
                         'before' => '<div class="sticky-message">',
                         'after'  => '</div>',
                 ) );
         }
 }

 add_action( 'wp_enqueue_scripts', 'mobile_first_sticky_message_scripts' );
 function mobile_first_sticky_message_scripts() {
         wp_enqueue_script( 'mobile-first-stickey-message', get_bloginfo(
 'stylesheet_directory' ) . '/js/sticky-messages.js', array( 'jquery' ),
 '1.0.1' );

 }
 }}}

 so would I just change to


 {{{
 if ( ! is_user_logged_in() || is_customize_preview() ) {
 }}}

 If so that's an easy fix. Sorry, I thought it was a customizer thing.

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


More information about the wp-trac mailing list