[wp-trac] [WordPress Trac] #40432: Customizer: Should we stop contextually hiding features?

WordPress Trac noreply at wordpress.org
Sat Dec 16 03:36:57 UTC 2017


#40432: Customizer: Should we stop contextually hiding features?
-------------------------+------------------------------
 Reporter:  melchoyce    |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Customize    |     Version:  4.0
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  ui
-------------------------+------------------------------

Comment (by daviedR):

 Okay, let's see how it is going with the upcoming Gutenberg.

 By the way, I got a quick fix for disabling the sidebar's contextual
 hiding. You can define the `active_callback` argument on each sidebar
 section to always return true. This should be hooked into `wp` action,
 because WordPress defines the sidebar sections inside `wp` action.

 {{{
 add_action( 'wp', 'mytheme_disable_widgets_contextual_hiding' );
 function mytheme_disable_widgets_contextual_hiding() {
     global $wp_customize;

     if ( empty( $wp_customize ) ) {
         return;
     }

     // Sidebar ID: mytheme-sidebar
     $wp_customize->get_section( 'sidebar-widgets-mytheme-sidebar'
 )->active_callback = '__return_true';

     // ... Do it for other sidebar IDs too ...
 }
 }}}

 This will make all sidebars visible on the customizer.

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


More information about the wp-trac mailing list