wppaste
WordPress

WP_Customize_Nav_Menu_Item_Control

Since
4.3.0
Source
wp-includes/customize/class-wp-customize-nav-menu-item-control.php:17
Customize control to represent the name field for a given menu.

Compatibility

WordPress
since 4.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Hooks and filters fired · 1

Every hook that fires from inside WP_Customize_Nav_Menu_Item_Control, in the order it appears in the class, grouped by the method that fires it.

Properties · 2

$typestringpublic
Control type.
$settingWP_Customize_Nav_Menu_Item_Settingpublic
The nav menu item setting.

Methods · 4

Source code

class WP_Customize_Nav_Menu_Item_Control extends WP_Customize_Control { 	/**	 * Control type.	 *	 * @since 4.3.0	 * @var string	 */	public $type = 'nav_menu_item'; 	/**	 * The nav menu item setting.	 *	 * @since 4.3.0	 * @var WP_Customize_Nav_Menu_Item_Setting	 */	public $setting; 	/**	 * Constructor.	 *	 * @since 4.3.0	 *	 * @see WP_Customize_Control::__construct()	 *	 * @param WP_Customize_Manager $manager Customizer bootstrap instance.	 * @param string               $id      The control ID.	 * @param array                $args    Optional. Arguments to override class property defaults.	 *                                      See WP_Customize_Control::__construct() for information	 *                                      on accepted arguments. Default empty array.	 */	public function __construct( $manager, $id, $args = array() ) {		parent::__construct( $manager, $id, $args );	} 	/**	 * Don't render the control's content - it's rendered with a JS template.	 *	 * @since 4.3.0	 */	public function render_content() {} 	/**	 * JS/Underscore template for the control UI.	 *	 * @since 4.3.0	 */	public function content_template() {		?>		<div class="menu-item-bar">			<div class="menu-item-handle">				<span class="item-type" aria-hidden="true">{{ data.item_type_label }}</span>				<span class="item-title" aria-hidden="true">					<span class="spinner"></span>					<span class="menu-item-title<# if ( ! data.title && ! data.original_title ) { #> no-title<# } #>">{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}</span>					<# if ( 0 === data.depth ) { #>						<span class="is-submenu" style="display: none;"><?php _e( 'sub item' ); ?></span>					<# } else { #>						<span class="is-submenu"><?php _e( 'sub item' ); ?></span>					<# } #>				</span>				<span class="item-controls">					<button type="button" class="button-link item-edit" aria-expanded="false"><span class="screen-reader-text">					<# if ( 0 === data.depth ) { #>						<?php						/* translators: 1: Title of a menu item, 2: Type of a menu item. 3: Item index, 4: Total items. */						printf( __( 'Edit %1$s (%2$s, %3$d of %4$d)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}', '', '' );						?>					<# } else if ( 1 === data.depth ) { #>						<?php							/* translators: 1: Title of a menu item, 2: Type of a menu item, 3, Item index, 4, Total items, 5: Item parent. */							printf( __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}', '', '', '' );						?>					<# } else { #>						<?php							/* translators: 1: Title of a menu item, 2: Type of a menu item, 3, Item index, 4, Total items, 5: Item parent, 6: Item depth. */							printf( __( 'Edit %1$s (%2$s, sub-item %3$d of %4$d under %5$s, level %6$s)' ), '{{ data.title || data.original_title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}', '', '', '', '{{data.depth}}' );						?>					<# } #>					</span><span class="toggle-indicator" aria-hidden="true"></span></button>

Changelog

Introduced in 4.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/customize/class-wp-customize-nav-menu-item-control.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.