0

I am currently working on a theme that uses the Wordpress Customization API and I need to remove some pre-existing sections from the customization preview pane. Is there somewhere like a global variable holding an array of the sections perhaps (in true Wordpress style) I can unset the navigation section in particular?

Please see attached image for what I am talking about. I've circled it in red.

enter image description here

1

Just call remove_section method of the $wp_customize object:

add_action( 'customize_register', 'wpse8170_customize_register' );
function wpse8170_customize_register( WP_Customize_Manager $wp_customize ) {
    $wp_customize->remove_section( 'section-id-to-remove' );
}
  • Wow. I did not realise there was a remove_section method. I did some searching, but should have looked in the codebase. – Dwayne Charrington Jan 31 '13 at 22:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.