WP_Customize_Manager::remove_panel()
Removes a customize panel.
Note that removing the panel doesn't destroy the WP_Customize_Panel instance or remove its filters.
Method of the class: WP_Customize_Manager{}
No Hooks.
Return
null
. Ничего (null).
Usage
$WP_Customize_Manager = new WP_Customize_Manager(); $WP_Customize_Manager->remove_panel( $id );
- $id(string) (required)
- Panel ID to remove.
Changelog
Since 4.0.0 | Introduced. |
WP_Customize_Manager::remove_panel() WP Customize Manager::remove panel code WP 6.4.1
public function remove_panel( $id ) { // Removing core components this way is _doing_it_wrong(). if ( in_array( $id, $this->components, true ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: 1: Panel ID, 2: Link to 'customize_loaded_components' filter reference. */ __( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ), $id, sprintf( '<a href="%1$s">%2$s</a>', esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ), '<code>customize_loaded_components</code>' ) ), '4.5.0' ); } unset( $this->panels[ $id ] ); }