WP_Customize_Manager::remove_panel PHP Method

remove_panel() public method

Remove a customize panel.
Since: 4.0.0
public remove_panel ( string $id )
$id string Panel ID to remove.
    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]);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Removes all non-AMP sections and panels.
  *
  * Provides a clean, standalone instance-like experience by removing all non-AMP registered panels and sections.
  *
  * @since 0.4
  * @access private
  */
 private function _unregister_core_ui()
 {
     $panels = $this->wp_customize->panels();
     $sections = $this->wp_customize->sections();
     foreach ($panels as $panel_id => $object) {
         $this->wp_customize->remove_panel($panel_id);
     }
     foreach ($sections as $section_id => $object) {
         $this->wp_customize->remove_section($section_id);
     }
 }
All Usage Examples Of WP_Customize_Manager::remove_panel
WP_Customize_Manager