unregister_sidebar() in stand-alone theme not working

Thanks to Milo and G.M. for pointing to the master key, as G.M. said: you have to use a lower priority than one register_sidebar runs, but lower priority means higher number. So the final code that is working: function site_unregister_sidebar() { if ( is_admin() && current_user_can(‘editor’) ) { unregister_sidebar( ‘my_custom_widget_area’ ); } } add_action(‘widgets_init’, ‘site_unregister_sidebar’, … Read more

How can you add a link to a sidebar description?

The sidebar description runs through esc_html(), so you cannot pass HTML directly. But you can use the filter esc_html to insert your desired content. Here is a simple example: add_action( ‘widgets_init’, function() { $desc = “Read the <a href=”http://wordpress.stackexchange.com/q/189749/73″>explanation</a>!”; $placeholder=”PLACEHOLDER”; register_sidebar([ ‘id’ => ‘wpse-189749’, ‘name’ => ‘Link description’, ‘description’ => $placeholder ]); add_action( ‘widgets_admin_page’, function() … Read more

Display sidebar if blog

There is no conditional tag for the blog page. You have to use both is_home() and is_front_page() to detect this page When you use is_home() and is_front_page(), you have to use them in the right order to avoid bugs and to test every user configuration: <?php if ( is_front_page() && is_home() ) { // blog … Read more

Unregister sidebar from Child-Theme

Check the code bellow, I think that should work. add_action( ‘after_setup_theme’, ‘remove_default_sidebars’, 11 ); function remove_default_sidebars(){ remove_action( ‘widgets_init’, ‘starkers_widgets_init’ ); }

Backend menu sidebar collapsed by default every time? [duplicate]

The following works with a regular site. I have’t worked with multisite yet, but I imagine it should be something along the same line: function change_user_settings() { set_user_setting(‘mfold’, ‘f’); //Missing “t” typo caused fatal error } add_action(‘admin_init’, ‘change_user_settings’);

techhipbettruvabetnorabahisbahis forumutaraftarium24edueduseduedueduedusedusedueduedus