0

I want to remove/disable the 'Active Theme' section from customizer. What could be the best way to do it? enter image description here

2 Answers 2

1

Untested, but this should do the trick:

function wpse293862_remove_themes_panel() { global $wp_customize; $wp_customize->remove_panel( 'themes' ); } add_action( 'customize_register', 'wpse293862_remove_themes_panel', 11 ); 
2
  • tested. It's working Commented Feb 12, 2018 at 11:35
  • 1
    Yes, this is the approach I would recommend. Commented Feb 20, 2018 at 1:13
1

To remove a panel completely use the WP_Customize_Manager class remove_panel( string $id ) method. Reference https://developer.wordpress.org/reference/classes/wp_customize_manager/

function themeslug_customizer_remove( $wp_customize ) { $wp_customize->remove_panel( 'themes' ); } add_action( 'customize_register', 'themeslug_customizer_remove' ); 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.