If you check out the source of WP_Customizer
, you’ll see there is no title_tagline
or header_image
at the time the filter runs:
final class WP_Customize_Manager {
protected $components = array( 'widgets', 'nav_menus' );
public function __construct() {
// a bunch of requires
$components = apply_filters( 'customize_loaded_components', $this->components, $this );
}
}
Use the customize_register
hook to remove the sections after WP has added them:
function wpse_225164_remove_core_sections( $wp_customize ) {
$wp_customize->remove_section( 'title_tagline' );
$wp_customize->remove_section( 'header_image' );
}
add_action( 'customize_register', 'wpse_225164_remove_core_sections' );