read

The WordPress Customizer is not just for themes, it can also be used for plugins. I’ve seen for example a brilliant newsletters plugin that used the customizer for composing the actual emails, and the implementation was awesome. In cases like that, you may want to remove the WordPress Themes switcher from the WordPress Customizer.

This is a simple function you can use to do just that:

<?php

/**
 * This function removes the themes section from the customizer.
 */
function custom_remove_themes_section() {
	global $wp_customize;
	$wp_customize->remove_section( 'themes' );
	$wp_customize->remove_control( 'active_theme' );
}
add_action( 'customize_register', 'custom_remove_themes_section' );

?>
Blog Logo

Aristeides Stathopoulos


Published

Image

Aristeides Stathopoulos

WordPress Developer, Human.

Back to Overview

If you like and use my work, you can buy me a beer or coffee. ¯\_(ツ)_/¯