add_section example


                    $section_args = apply_filters( 'customizer_widgets_section_args', $section_args$section_id$sidebar_id );

                    $section = new WP_Customize_Sidebar_Section( $this->manager, $section_id$section_args );
                    $this->manager->add_section( $section );

                    if ( $use_widgets_block_editor ) {
                        $control = new WP_Sidebar_Block_Editor_Control(
                            $this->manager,
                            $setting_id,
                            array(
                                'section'     => $section_id,
                                'sidebar_id'  => $sidebar_id,
                                'label'       => $section_args['title'],
                                'description' => $section_args['description'],
                            )
                        );
'title'       => $this->theme()->display( 'Name' ),
                    'description' => (
                    '<p>' . __( 'Looking for a theme? You can search or browse the WordPress.org theme directory, install and preview themes, then activate them right here.' ) . '</p>' .
                    '<p>' . __( 'While previewing a new theme, you can continue to tailor things like widgets and menus, and explore theme-specific options.' ) . '</p>'
                    ),
                    'capability'  => 'switch_themes',
                    'priority'    => 0,
                )
            )
        );

        $this->add_section(
            new WP_Customize_Themes_Section(
                $this,
                'installed_themes',
                array(
                    'title'      => __( 'Installed themes' ),
                    'action'     => 'installed',
                    'capability' => 'switch_themes',
                    'panel'      => 'themes',
                    'priority'   => 0,
                )
            )
        );
$description = '<p>' . __( 'Your theme can display menus in one location. Select which menu you would like to use.' ) . '</p>';
        } else {
            /* translators: %s: Number of menu locations. */
            $description = '<p>' . sprintf( _n( 'Your theme can display menus in %s location. Select which menu you would like to use.', 'Your theme can display menus in %s locations. Select which menu appears in each location.', $num_locations )number_format_i18n( $num_locations ) ) . '</p>';
        }

        if ( current_theme_supports( 'widgets' ) ) {
            /* translators: URL to the Widgets panel of the Customizer. */
            $description .= '<p>' . sprintf( __( 'If your theme has widget areas, you can also add menus there. Visit the <a href="%s">Widgets panel</a> and add a &#8220;Navigation Menu widget&#8221; to display a menu in a sidebar or footer.' ), "javascript:wp.customize.panel( 'widgets' ).focus();" ) . '</p>';
        }

        $this->manager->add_section(
            'menu_locations',
            array(
                'title'       => 1 === $num_locations ? _x( 'View Location', 'menu locations' ) : _x( 'View All Locations', 'menu locations' ),
                'panel'       => 'nav_menus',
                'priority'    => 30,
                'description' => $description,
            )
        );

        $choices = array( '0' => __( '&mdash; Select &mdash;' ) );
        foreach ( $menus as $menu ) {
            
'display_title_and_tagline',
                array(
                    'type'    => 'checkbox',
                    'section' => 'title_tagline',
                    'label'   => esc_html__( 'Display Site Title & Tagline', 'twentytwentyone' ),
                )
            );

            /** * Add excerpt or full text selector to customizer */
            $wp_customize->add_section(
                'excerpt_settings',
                array(
                    'title'    => esc_html__( 'Excerpt Settings', 'twentytwentyone' ),
                    'priority' => 120,
                )
            );

            $wp_customize->add_setting(
                'display_excerpt_or_full_post',
                array(
                    'capability'        => 'edit_theme_options',
                    
Home | Imprint | This part of the site doesn't use cookies.