class-wp-customize-nav-menu-auto-add-control.php 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Customize API: WP_Customize_Nav_Menu_Auto_Add_Control class
  4. *
  5. * @package WordPress
  6. * @subpackage Customize
  7. * @since 4.4.0
  8. */
  9. /**
  10. * Customize control to represent the auto_add field for a given menu.
  11. *
  12. * @since 4.3.0
  13. *
  14. * @see WP_Customize_Control
  15. */
  16. class WP_Customize_Nav_Menu_Auto_Add_Control extends WP_Customize_Control {
  17. /**
  18. * Type of control, used by JS.
  19. *
  20. * @since 4.3.0
  21. * @access public
  22. * @var string
  23. */
  24. public $type = 'nav_menu_auto_add';
  25. /**
  26. * No-op since we're using JS template.
  27. *
  28. * @since 4.3.0
  29. * @access protected
  30. */
  31. protected function render_content() {}
  32. /**
  33. * Render the Underscore template for this control.
  34. *
  35. * @since 4.3.0
  36. * @access protected
  37. */
  38. protected function content_template() {
  39. ?>
  40. <span class="customize-control-title"><?php _e( 'Menu Options' ); ?></span>
  41. <label>
  42. <input type="checkbox" class="auto_add" />
  43. <?php _e( 'Automatically add new top-level pages to this menu' ); ?>
  44. </label>
  45. <?php
  46. }
  47. }