Make WordPress Core


Ignore:
Timestamp:
06/19/2015 08:36:37 AM (11 years ago)
Author:
obenland
Message:

Keep WP_Customize_Nav_Menus_Panel with other panels rather than controls.

Accidentally merged into the wrong file in [32806].
H/t celloexpressions for noticing.

See https://wordpress.slack.com/archives/core-customize/p1434696254000258.
See #32576.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-control.php

    r32848 r32855  
    14051405
    14061406/**
    1407  * Customize Nav Menus Panel Class
    1408  *
    1409  * Needed to add screen options.
    1410  *
    1411  * @since 4.3.0
    1412  */
    1413 class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
    1414 
    1415     /**
    1416      * Control type.
    1417      *
    1418      * @since 4.3.0
    1419      *
    1420      * @access public
    1421      * @var string
    1422      */
    1423     public $type = 'nav_menus';
    1424 
    1425     /**
    1426      * Render screen options for Menus.
    1427      *
    1428      * @since 4.3.0
    1429      */
    1430     public function render_screen_options() {
    1431         // Essentially adds the screen options.
    1432         add_filter( 'manage_nav-menus_columns', array( $this, 'wp_nav_menu_manage_columns' ) );
    1433 
    1434         // Display screen options.
    1435         $screen = WP_Screen::get( 'nav-menus.php' );
    1436         $screen->render_screen_options();
    1437     }
    1438 
    1439     /**
    1440      * Returns the advanced options for the nav menus page.
    1441      *
    1442      * Link title attribute added as it's a relatively advanced concept for new users.
    1443      *
    1444      * @since 4.3.0
    1445      *
    1446      * @return array The advanced menu properties.
    1447      */
    1448     function wp_nav_menu_manage_columns() {
    1449         return array(
    1450             '_title'      => __( 'Show advanced menu properties' ),
    1451             'cb'          => '<input type="checkbox" />',
    1452             'link-target' => __( 'Link Target' ),
    1453             'attr-title'  => __( 'Title Attribute' ),
    1454             'css-classes' => __( 'CSS Classes' ),
    1455             'xfn'         => __( 'Link Relationship (XFN)' ),
    1456             'description' => __( 'Description' ),
    1457         );
    1458     }
    1459 
    1460     /**
    1461      * An Underscore (JS) template for this panel's content (but not its container).
    1462      *
    1463      * Class variables for this panel class are available in the `data` JS object;
    1464      * export custom variables by overriding {@see WP_Customize_Panel::json()}.
    1465      *
    1466      * @since 4.3.0
    1467      *
    1468      * @see WP_Customize_Panel::print_template()
    1469      *
    1470      * @since 4.3.0
    1471      */
    1472     protected function content_template() {
    1473         ?>
    1474         <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
    1475             <button type="button" class="customize-panel-back" tabindex="-1">
    1476                 <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
    1477             </button>
    1478             <div class="accordion-section-title">
    1479                 <span class="preview-notice">
    1480                     <?php
    1481                         /* translators: %s is the site/panel title in the Customizer */
    1482                         printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
    1483                     ?>
    1484                 </span>
    1485                 <button type="button" class="customize-screen-options-toggle" aria-expanded="false">
    1486                     <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
    1487                 </button>
    1488                 <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
    1489                     <span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
    1490                 </button>
    1491             </div>
    1492             <# if ( data.description ) { #>
    1493             <div class="description customize-panel-description">{{{ data.description }}}</div>
    1494             <# } #>
    1495             <?php $this->render_screen_options(); ?>
    1496         </li>
    1497         <?php
    1498     }
    1499 }
    1500 
    1501 /**
    15021407 * Customize Nav Menu Control Class
    15031408 *
Note: See TracChangeset for help on using the changeset viewer.