3 * Customize API: WP_Customize_Nav_Menus_Panel class
6 * @subpackage Customize
11 * Customize Nav Menus Panel Class
13 * Needed to add screen options.
17 * @see WP_Customize_Panel
19 class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
28 public $type = 'nav_menus';
31 * Render screen options for Menus.
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' );
41 // Display screen options.
42 $screen = WP_Screen::get( 'nav-menus.php' );
43 $screen->render_screen_options( array( 'wrap' => false ) );
47 * Returns the advanced options for the nav menus page.
49 * Link title attribute added as it's a relatively advanced concept for new users.
52 * @deprecated 4.5.0 Deprecated in favor of wp_nav_menu_manage_columns().
54 public function wp_nav_menu_manage_columns() {
55 _deprecated_function( __METHOD__, '4.5.0', 'wp_nav_menu_manage_columns' );
56 require_once ABSPATH . 'wp-admin/includes/nav-menu.php';
57 return wp_nav_menu_manage_columns();
61 * An Underscore (JS) template for this panel's content (but not its container).
63 * Class variables for this panel class are available in the `data` JS object;
64 * export custom variables by overriding WP_Customize_Panel::json().
69 * @see WP_Customize_Panel::print_template()
71 protected function content_template() {
73 <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
74 <button type="button" class="customize-panel-back" tabindex="-1">
75 <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
77 <div class="accordion-section-title">
78 <span class="preview-notice">
80 /* translators: %s: the site/panel title in the Customizer */
81 printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
84 <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
85 <span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
87 <button type="button" class="customize-screen-options-toggle" aria-expanded="false">
88 <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
91 <# if ( data.description ) { #>
92 <div class="description customize-panel-description">{{{ data.description }}}</div>
94 <div id="screen-options-wrap">
95 <?php $this->render_screen_options(); ?>