WP_Customize_Manager::remove_panel( string $id )
Remove a customize panel.
Description Description
Parameters Parameters
- $id
-
(string) (Required) Panel ID to remove.
Source Source
File: wp-includes/class-wp-customize-manager.php
public function remove_panel( $id ) {
// Removing core components this way is _doing_it_wrong().
if ( in_array( $id, $this->components, true ) ) {
/* translators: 1: panel id, 2: link to 'customize_loaded_components' filter reference */
$message = sprintf(
__( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
$id,
'<a href="' . esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ) . '"><code>customize_loaded_components</code></a>'
);
_doing_it_wrong( __METHOD__, $message, '4.5.0' );
}
unset( $this->panels[ $id ] );
}
Expand full source code Collapse full source code View on Trac
Changelog Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |
User Contributed Notes User Contributed Notes
You must log in before being able to contribute a note or feedback.
To remove Themes panel from customizer use the following code sample.
function themeslug_customizer_remove( $wp_customize ) { $wp_customize->remove_panel( 'themes' ); } add_action( 'customize_register', 'themeslug_customizer_remove' );