I want to remove/disable the 'Active Theme' section from customizer. What could be the best way to do it? 
2 Answers
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 ); -
- 1Yes, this is the approach I would recommend.Weston Ruter– Weston Ruter2018-02-20 01:13:42 +00:00Commented Feb 20, 2018 at 1:13
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' );