WP_Customize_Nav_Menus::print_custom_links_available_menu_item() WordPress Method
The WP_Customize_Nav_Menus::print_custom_links_available_menu_item() function is used to output a menu item for the available custom links. This function is used when the user is adding new menu items in the customizer. It outputs a menu item that can be added to the menu. The menu item includes the title of the link and the URL.
WP_Customize_Nav_Menus::print_custom_links_available_menu_item() #
Prints the markup for available menu item custom links.
Source
File: wp-includes/class-wp-customize-nav-menus.php
protected function print_custom_links_available_menu_item() { ?> <div id="new-custom-menu-item" class="accordion-section"> <h4 class="accordion-section-title" role="presentation"> <?php _e( 'Custom Links' ); ?> <button type="button" class="button-link" aria-expanded="false"> <span class="screen-reader-text"><?php _e( 'Toggle section: Custom Links' ); ?></span> <span class="toggle-indicator" aria-hidden="true"></span> </button> </h4> <div class="accordion-section-content customlinkdiv"> <input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" /> <p id="menu-item-url-wrap" class="wp-clearfix"> <label class="howto" for="custom-menu-item-url"><?php _e( 'URL' ); ?></label> <input id="custom-menu-item-url" name="menu-item[-1][menu-item-url]" type="text" class="code menu-item-textbox" placeholder="https://"> </p> <p id="menu-item-name-wrap" class="wp-clearfix"> <label class="howto" for="custom-menu-item-name"><?php _e( 'Link Text' ); ?></label> <input id="custom-menu-item-name" name="menu-item[-1][menu-item-title]" type="text" class="regular-text menu-item-textbox"> </p> <p class="button-controls"> <span class="add-to-menu"> <input type="submit" class="button submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu' ); ?>" name="add-custom-menu-item" id="custom-menu-item-submit"> <span class="spinner"></span> </span> </p> </div> </div> <?php }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |