register_panel_type example

$nav_menus_setting_ids[] = $setting_id;
            }
        }
        $settings = $this->manager->add_dynamic_settings( $nav_menus_setting_ids );
        if ( $this->manager->settings_previewed() ) {
            foreach ( $settings as $setting ) {
                $setting->preview();
            }
        }

        // Require JS-rendered control types.         $this->manager->register_panel_type( 'WP_Customize_Nav_Menus_Panel' );
        $this->manager->register_control_type( 'WP_Customize_Nav_Menu_Control' );
        $this->manager->register_control_type( 'WP_Customize_Nav_Menu_Name_Control' );
        $this->manager->register_control_type( 'WP_Customize_Nav_Menu_Locations_Control' );
        $this->manager->register_control_type( 'WP_Customize_Nav_Menu_Auto_Add_Control' );
        $this->manager->register_control_type( 'WP_Customize_Nav_Menu_Item_Control' );

        // Create a panel for Menus.         $description = '<p>' . __( 'This panel is used for managing navigation menus for content you have already published on your site. You can create menus and add items for existing content such as pages, posts, categories, tags, formats, or custom links.' ) . '</p>';
        if ( current_theme_supports( 'widgets' ) ) {
            $description .= '<p>' . sprintf(
                /* translators: %s: URL to the Widgets panel of the Customizer. */
                
/** * Registers styles/scripts and initialize the preview of each setting * * @since 3.4.0 */
    public function wp_loaded() {

        /* * Unconditionally register core types for panels, sections, and controls * in case plugin unhooks all customize_register actions. */
        $this->register_panel_type( 'WP_Customize_Panel' );
        $this->register_panel_type( 'WP_Customize_Themes_Panel' );
        $this->register_section_type( 'WP_Customize_Section' );
        $this->register_section_type( 'WP_Customize_Sidebar_Section' );
        $this->register_section_type( 'WP_Customize_Themes_Section' );
        $this->register_control_type( 'WP_Customize_Color_Control' );
        $this->register_control_type( 'WP_Customize_Media_Control' );
        $this->register_control_type( 'WP_Customize_Upload_Control' );
        $this->register_control_type( 'WP_Customize_Image_Control' );
        $this->register_control_type( 'WP_Customize_Background_Image_Control' );
        $this->register_control_type( 'WP_Customize_Background_Position_Control' );
        $this->register_control_type( 'WP_Customize_Cropped_Image_Control' );
        
Home | Imprint | This part of the site doesn't use cookies.