/wp-includes/customize/class-wp-customize-nav-menus-panel.php

  1. <?php 
  2. /** 
  3. * Customize API: WP_Customize_Nav_Menus_Panel class 
  4. * 
  5. * @package WordPress 
  6. * @subpackage Customize 
  7. * @since 4.4.0 
  8. */ 
  9.  
  10. /** 
  11. * Customize Nav Menus Panel Class 
  12. * 
  13. * Needed to add screen options. 
  14. * 
  15. * @since 4.3.0 
  16. * 
  17. * @see WP_Customize_Panel 
  18. */ 
  19. class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel { 
  20.  
  21. /** 
  22. * Control type. 
  23. * 
  24. * @since 4.3.0 
  25. * @access public 
  26. * @var string 
  27. */ 
  28. public $type = 'nav_menus'; 
  29.  
  30. /** 
  31. * Render screen options for Menus. 
  32. * 
  33. * @since 4.3.0 
  34. * @access public 
  35. */ 
  36. public function render_screen_options() { 
  37. // Adds the screen options. 
  38. require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 
  39. add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); 
  40.  
  41. // Display screen options. 
  42. $screen = WP_Screen::get( 'nav-menus.php' ); 
  43. $screen->render_screen_options( array( 'wrap' => false ) ); 
  44.  
  45. /** 
  46. * Returns the advanced options for the nav menus page. 
  47. * 
  48. * Link title attribute added as it's a relatively advanced concept for new users. 
  49. * 
  50. * @since 4.3.0 
  51. * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns(). 
  52. */ 
  53. public function wp_nav_menu_manage_columns() { 
  54. _deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' ); 
  55. require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 
  56. return wp_nav_menu_manage_columns(); 
  57.  
  58. /** 
  59. * An Underscore (JS) template for this panel's content (but not its container). 
  60. * 
  61. * Class variables for this panel class are available in the `data` JS object; 
  62. * export custom variables by overriding WP_Customize_Panel::json(). 
  63. * 
  64. * @since 4.3.0 
  65. * @access protected 
  66. * 
  67. * @see WP_Customize_Panel::print_template() 
  68. */ 
  69. protected function content_template() { 
  70. ?> 
  71. <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"> 
  72. <button type="button" class="customize-panel-back" tabindex="-1"> 
  73. <span class="screen-reader-text"><?php _e( 'Back' ); ?></span> 
  74. </button> 
  75. <div class="accordion-section-title"> 
  76. <span class="preview-notice"> 
  77. <?php 
  78. /** translators: %s: the site/panel title in the Customizer */ 
  79. printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' ); 
  80. ?> 
  81. </span> 
  82. <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"> 
  83. <span class="screen-reader-text"><?php _e( 'Help' ); ?></span> 
  84. </button> 
  85. <button type="button" class="customize-screen-options-toggle" aria-expanded="false"> 
  86. <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span> 
  87. </button> 
  88. </div> 
  89. <# if ( data.description ) { #> 
  90. <div class="description customize-panel-description">{{{ data.description }}}</div> 
  91. <# } #> 
  92. <div id="screen-options-wrap"> 
  93. <?php $this->render_screen_options(); ?> 
  94. </div> 
  95. </li> 
  96. <?php 
.