WP_Customize_Nav_Menus::available_items_template()publicWP 4.3.0

Prints the HTML template used to render the add-menu-item frame.

Method of the class: WP_Customize_Nav_Menus{}

No Hooks.

Return

null. Nothing (null).

Usage

$WP_Customize_Nav_Menus = new WP_Customize_Nav_Menus();
$WP_Customize_Nav_Menus->available_items_template();

Changelog

Since 4.3.0 Introduced.

WP_Customize_Nav_Menus::available_items_template() code WP 6.5.3

<?php
public function available_items_template() {
	?>
	<div id="available-menu-items" class="accordion-container">
		<div class="customize-section-title">
			<button type="button" class="customize-section-back" tabindex="-1">
				<span class="screen-reader-text">
					<?php
					/* translators: Hidden accessibility text. */
					_e( 'Back' );
					?>
				</span>
			</button>
			<h3>
				<span class="customize-action">
					<?php
						/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
						printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) );
					?>
				</span>
				<?php _e( 'Add Menu Items' ); ?>
			</h3>
		</div>
		<div id="available-menu-items-search" class="accordion-section cannot-expand">
			<div class="accordion-section-title">
				<label class="screen-reader-text" for="menu-items-search">
					<?php
					/* translators: Hidden accessibility text. */
					_e( 'Search Menu Items' );
					?>
				</label>
				<input type="text" id="menu-items-search" placeholder="<?php esc_attr_e( 'Search menu items&hellip;' ); ?>" aria-describedby="menu-items-search-desc" />
				<p class="screen-reader-text" id="menu-items-search-desc">
					<?php
					/* translators: Hidden accessibility text. */
					_e( 'The search results will be updated as you type.' );
					?>
				</p>
				<span class="spinner"></span>
			</div>
			<div class="search-icon" aria-hidden="true"></div>
			<button type="button" class="clear-results"><span class="screen-reader-text">
				<?php
				/* translators: Hidden accessibility text. */
				_e( 'Clear Results' );
				?>
			</span></button>
			<ul class="accordion-section-content available-menu-items-list" data-type="search"></ul>
		</div>
		<?php

		// Ensure the page post type comes first in the list.
		$item_types     = $this->available_item_types();
		$page_item_type = null;
		foreach ( $item_types as $i => $item_type ) {
			if ( isset( $item_type['object'] ) && 'page' === $item_type['object'] ) {
				$page_item_type = $item_type;
				unset( $item_types[ $i ] );
			}
		}

		$this->print_custom_links_available_menu_item();
		if ( $page_item_type ) {
			$this->print_post_type_container( $page_item_type );
		}
		// Containers for per-post-type item browsing; items are added with JS.
		foreach ( $item_types as $item_type ) {
			$this->print_post_type_container( $item_type );
		}
		?>
	</div><!-- #available-menu-items -->
	<?php
}