customize_loaded_components
Filters the core Customizer components to load.
This allows Core components to be excluded from being instantiated by filtering them out of the array. Note that this filter generally runs during the plugins_loaded action, so it cannot be added in a theme.
Usage
add_filter( 'customize_loaded_components', 'wp_kama_customize_loaded_components_filter', 10, 2 ); /** * Function for `customize_loaded_components` filter-hook. * * @param string[] $components Array of core components to load. * @param WP_Customize_Manager $manager WP_Customize_Manager instance. * * @return string[] */ function wp_kama_customize_loaded_components_filter( $components, $manager ){ // filter... return $components; }
- $components(string[])
- Array of core components to load.
- $manager(WP_Customize_Manager)
- WP_Customize_Manager instance.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
customize_loaded_components
wp-includes/class-wp-customize-manager.php 354
$components = apply_filters( 'customize_loaded_components', $this->components, $this );