WP_Customize_Nav_Menu_Location_Control example

'default'           => 0,
                    )
                );
            }

            // Override the assigned nav menu location if mapped during previewed theme switch.             if ( empty( $changeset[ $setting_id ] ) && isset( $mapped_nav_menu_locations[ $location ] ) ) {
                $this->manager->set_post_value( $setting_id$mapped_nav_menu_locations[ $location ] );
            }

            $this->manager->add_control(
                new WP_Customize_Nav_Menu_Location_Control(
                    $this->manager,
                    $setting_id,
                    array(
                        'label'       => $description,
                        'location_id' => $location,
                        'section'     => 'menu_locations',
                        'choices'     => $choices,
                    )
                )
            );
        }

        
Home | Imprint | This part of the site doesn't use cookies.