class-wp-customize-nav-menu-name-control.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Customize API: WP_Customize_Nav_Menu_Name_Control class
  4. *
  5. * @package WordPress
  6. * @subpackage Customize
  7. * @since 4.4.0
  8. */
  9. /**
  10. * Customize control to represent the name field for a given menu.
  11. *
  12. * @since 4.3.0
  13. *
  14. * @see WP_Customize_Control
  15. */
  16. class WP_Customize_Nav_Menu_Name_Control extends WP_Customize_Control {
  17. /**
  18. * Type of control, used by JS.
  19. *
  20. * @since 4.3.0
  21. * @var string
  22. */
  23. public $type = 'nav_menu_name';
  24. /**
  25. * No-op since we're using JS template.
  26. *
  27. * @since 4.3.0
  28. */
  29. protected function render_content() {}
  30. /**
  31. * Render the Underscore template for this control.
  32. *
  33. * @since 4.3.0
  34. */
  35. protected function content_template() {
  36. ?>
  37. <label>
  38. <# if ( data.label ) { #>
  39. <span class="customize-control-title">{{ data.label }}</span>
  40. <# } #>
  41. <input type="text" class="menu-name-field live-update-section-title"
  42. <# if ( data.description ) { #>
  43. aria-describedby="{{ data.section }}-description"
  44. <# } #>
  45. />
  46. </label>
  47. <# if ( data.description ) { #>
  48. <p id="{{ data.section }}-description">{{ data.description }}</p>
  49. <# } #>
  50. <?php
  51. }
  52. }