Skip to content

Instantly share code, notes, and snippets.

@embolden
Created June 2, 2016 18:52
Show Gist options
  • Save embolden/1ff4c0c188a359d004fd3400ded2a4a3 to your computer and use it in GitHub Desktop.
Save embolden/1ff4c0c188a359d004fd3400ded2a4a3 to your computer and use it in GitHub Desktop.
<?php
/**
* @todo Document me!
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
function _s_remove_default_customerizer( $wp_customize ) {
// Remove unused defaults
// Site Identity
// $wp_customize->remove_section( 'title_tagline' );
$wp_customize->remove_control( 'blogname' );
$wp_customize->remove_control( 'blogdescription' );
$wp_customize->remove_control( 'header_text' );
$wp_customize->remove_control( 'site_icon' );
$wp_customize->remove_control( 'custom_logo' );
$wp_customize->remove_control( 'display_header_text' );
// Colors
// $wp_customize->remove_section( 'colors' );
$wp_customize->remove_control( 'header_textcolor' );
$wp_customize->remove_control( 'background_color' );
// Header Image
$wp_customize->remove_section( 'header_image' );
// header_image is not managed the same way as other controls.
// Background Images
// $wp_customize->remove_section( 'background_image' );
$wp_customize->remove_control( 'background_image' );
$wp_customize->remove_control( 'background_repeat' );
$wp_customize->remove_control( 'background_position_x' );
$wp_customize->remove_control( 'background_attachment' );
// Menus
// menus is not managed the same way as other controls.
// Widgets
// widgets is not managed the same way as other controls.
// Static Front Page
// $wp_customize->remove_section( 'static_front_page' );
$wp_customize->remove_control( 'show_on_front' );
$wp_customize->remove_control( 'page_on_front' );
$wp_customize->remove_control( 'page_for_posts' );
}
add_action( 'customize_register', '_s_remove_default_customerizer' );
@embolden
Copy link
Author

embolden commented Jun 2, 2016

A section will hide itself w/out needing to remove it if you remove all the controls from it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment