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 // Essentially adds the screen options.
38 add_filter( 'manage_nav-menus_columns', array( $this, 'wp_nav_menu_manage_columns' ) );
40 // Display screen options.
41 $screen = WP_Screen::get( 'nav-menus.php' );
42 $screen->render_screen_options( array( 'wrap' => false ) );
46 * Returns the advanced options for the nav menus page.
48 * Link title attribute added as it's a relatively advanced concept for new users.
53 * @return array The advanced menu properties.
55 public function wp_nav_menu_manage_columns() {
57 '_title' => __( 'Show advanced menu properties' ),
58 'cb' => '<input type="checkbox" />',
59 'link-target' => __( 'Link Target' ),
60 'attr-title' => __( 'Title Attribute' ),
61 'css-classes' => __( 'CSS Classes' ),
62 'xfn' => __( 'Link Relationship (XFN)' ),
63 'description' => __( 'Description' ),
68 * An Underscore (JS) template for this panel's content (but not its container).
70 * Class variables for this panel class are available in the `data` JS object;
71 * export custom variables by overriding WP_Customize_Panel::json().
76 * @see WP_Customize_Panel::print_template()
78 protected function content_template() {
80 <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
81 <button type="button" class="customize-panel-back" tabindex="-1">
82 <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
84 <div class="accordion-section-title">
85 <span class="preview-notice">
87 /* Translators: %s is the site/panel title in the Customizer. */
88 printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
91 <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
92 <span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
94 <button type="button" class="customize-screen-options-toggle" aria-expanded="false">
95 <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
98 <# if ( data.description ) { #>
99 <div class="description customize-panel-description">{{{ data.description }}}</div>
101 <div id="screen-options-wrap">
102 <?php $this->render_screen_options(); ?>