Class: WP_Customize_Nav_Menu_Section

Extends WP_Customize_Section

Customize Menu Section Class

Custom section only needed in JS.


Name Type(s) Default Value Summary
type string Inherited ⋅ Type of this section.
instance_count integer InheritedStatic ⋅ Incremented with each new class instantiation, then stored in $instance_number.

Used when sorting two instances whose priorities are equal.

instance_number integer Inherited ⋅ Order in which this instance was created in relation to other instances.
manager WP_Customize_Manager Inherited ⋅ WP_Customize_Manager instance.
id string Inherited ⋅ Unique identifier.
priority integer Inherited ⋅ Priority of the section which informs load order of sections.
panel string Inherited ⋅ Panel in which to show the section, making it a sub-section.
capability string Inherited ⋅ Capability required for the section.
theme_supports string | array Inherited ⋅ Theme feature support for the section.
title string Inherited ⋅ Title of the section to show in UI.
description string Inherited ⋅ Description to show in the UI.
controls array Inherited ⋅ Customizer controls for this section.
active_callback callable Inherited ⋅ Active callback.
description_hidden boolean Inherited ⋅ Show the description or hide it behind the help icon.


WP_Customize_Nav_Menu_Section:: __construct( WP_Customize_Manager $manager, string $id, array $args = array() )

Constructor. Since 3.4.0.

Any supplied $args override class property defaults.


Name Type(s) Default Value Description
$manager WP_Customize_Manager

Customizer bootstrap instance.

$id string

An specific ID of the section.

$args array

Section arguments.

WP_Customize_Nav_Menu_Section:: active( )

Check whether section is active to current Customizer preview. Since 4.1.0.



Whether the section is active to the current preview.

WP_Customize_Nav_Menu_Section:: active_callback( )

Default callback used when invoking WP_Customize_Section::active(). Since 4.1.0.

Subclasses can override this with their specific logic, or they may provide an 'active_callback' argument to the constructor.



Always true.

WP_Customize_Nav_Menu_Section:: check_capabilities( )

Checks required user capabilities and whether the theme has the feature support required by the section. Since 3.4.0.



False if theme doesn't support the section or user doesn't have the capability.

WP_Customize_Nav_Menu_Section:: get_content( )

Get the section's content for insertion into the Customizer pane. Since 4.1.0.



Contents of the section.

WP_Customize_Nav_Menu_Section:: json( )

Gather the parameters passed to client JavaScript via JSON. Since 4.1.0.



The array to be exported to the client as JSON.

WP_Customize_Nav_Menu_Section:: maybe_render( )

Check capabilities and render the section. Since 3.4.0.

WP_Customize_Nav_Menu_Section:: print_template( )

Render the section's JS template. Since 4.3.0.

This function is only run for section types that have been registered with WP_Customize_Manager::register_section_type().

WP_Customize_Nav_Menu_Section:: render( )

Render the section UI in a subclass. Since 3.4.0.

Sections are now rendered in JS by default, see WP_Customize_Section::print_template().

WP_Customize_Nav_Menu_Section:: render_template( )

An Underscore (JS) template for rendering this section. Since 4.3.0.

Class variables for this section class are available in the data JS object; export custom variables by overriding WP_Customize_Section::json().

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.