Title: WP_Customize_Nav_Menus::available_items_template
Published: August 18, 2015
Last modified: May 20, 2026

---

# WP_Customize_Nav_Menus::available_items_template()

## In this article

 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#wp--skip-link--target)

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

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#source)󠁿

    ```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 for="menu-items-search"><?php _e( 'Search Menu Items' ); ?></label>
    				<input type="text" id="menu-items-search" 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 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>
    			</div>
    			<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
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-nav-menus.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-customize-nav-menus.php#L1150)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-customize-nav-menus.php#L1150-L1216)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_Customize_Nav_Menus::print_custom_links_available_menu_item()](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/print_custom_links_available_menu_item/)`wp-includes/class-wp-customize-nav-menus.php` |

Prints the markup for available menu item custom links.

  | 
| [WP_Customize_Nav_Menus::print_post_type_container()](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/print_post_type_container/)`wp-includes/class-wp-customize-nav-menus.php` |

Prints the markup for new menu items.

  | 
| [WP_Customize_Nav_Menus::available_item_types()](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_item_types/)`wp-includes/class-wp-customize-nav-menus.php` |

Returns an array of all the available item types.

  | 
| [_e()](https://developer.wordpress.org/reference/functions/_e/)`wp-includes/l10n.php` |

Displays translated text.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  |

[Show 3 more](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_nav_menus/available_items_template/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.3.0](https://developer.wordpress.org/reference/since/4.3.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_nav_menus%2Favailable_items_template%2F)
before being able to contribute a note or feedback.