In my WordPress theme that I’ve currently been building I do not take advantage of the WordPress Theme Customization API. As much as I would like too, I’ve invested far too much time into my own personal theme options framework for changing things.

This leads me to my question. How do I remove the blue, “Customize Your Site” button from the dashboard as well as link shown when viewing Appearance > Themes? I did some Googling, but my Google-Fu failed and couldn’t find a solution that didn’t use CSS or Javascript.

Ideally a hook to remove it would be best. But if there is no clean way to do so, a JS and or CSS solution would be fine.

5 s
5

With the lastest version of WordPress (4.3) you can now natively remove the customizer’s theme switch setting without resorting to CSS hacks.

/**
 * Remove customizer options.
 *
 * @since 1.0.0
 * @param object $wp_customize
 */
function ja_remove_customizer_options( $wp_customize ) {
   //$wp_customize->remove_section( 'static_front_page' );
   //$wp_customize->remove_section( 'title_tagline'     );
   //$wp_customize->remove_section( 'nav'               );
   $wp_customize->remove_section( 'themes'              );
}
add_action( 'customize_register', 'ja_remove_customizer_options', 30 );

Leave a Reply

Your email address will not be published. Required fields are marked *