Skip to main content
added 4 characters in body
Source Link
jessica
  • 1.4k
  • 12
  • 17

I found out the WP_Customize_Manager class has a function called remove_section(). In your function hooked to customize_register you can just do:

 $wp_customize->remove_section('nav'); $wp_customize->remove_section('static_front_page'); 

You can find the ID of the section (i.e. 'nav') if you inspect the accordion title bar of the section. Look at the ID of the containing <li> tag and it's the portion of the string after "customize-section-". I.E.:

<li id="customize-section-static_front_page" class="control-section customize-section"> 

-- the ID is "title_tagline""static_front_page"

I found out the WP_Customize_Manager class has a function called remove_section(). In your function hooked to customize_register you can just do:

 $wp_customize->remove_section('nav'); $wp_customize->remove_section('static_front_page'); 

You can find the ID of the section (i.e. 'nav') if you inspect the accordion title bar of the section. Look at the ID of the containing <li> tag and it's the portion of the string after "customize-section-". I.E.:

<li id="customize-section-static_front_page" class="control-section customize-section"> 

-- the ID is "title_tagline"

I found out the WP_Customize_Manager class has a function called remove_section(). In your function hooked to customize_register you can just do:

 $wp_customize->remove_section('nav'); $wp_customize->remove_section('static_front_page'); 

You can find the ID of the section (i.e. 'nav') if you inspect the accordion title bar of the section. Look at the ID of the containing <li> tag and it's the portion of the string after "customize-section-". I.E.:

<li id="customize-section-static_front_page" class="control-section customize-section"> 

-- the ID is "static_front_page"

Source Link
jessica
  • 1.4k
  • 12
  • 17

I found out the WP_Customize_Manager class has a function called remove_section(). In your function hooked to customize_register you can just do:

 $wp_customize->remove_section('nav'); $wp_customize->remove_section('static_front_page'); 

You can find the ID of the section (i.e. 'nav') if you inspect the accordion title bar of the section. Look at the ID of the containing <li> tag and it's the portion of the string after "customize-section-". I.E.:

<li id="customize-section-static_front_page" class="control-section customize-section"> 

-- the ID is "title_tagline"