Make WordPress Core


Ignore:
Timestamp:
10/24/2015 06:24:21 PM (10 years ago)
Author:
wonderboymusic
Message:

Customize: move WP_Customize_Panel subclass to wp-includes/customize, it loads in the exact same place.

See #34432.

File:
1 edited

Legend:

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

    r34093 r35386  
    385385}
    386386
    387 /**
    388  * Customize Nav Menus Panel Class
    389  *
    390  * Needed to add screen options.
    391  *
    392  * @since 4.3.0
    393  *
    394  * @see WP_Customize_Panel
    395  */
    396 class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
    397 
    398     /**
    399      * Control type.
    400      *
    401      * @since 4.3.0
    402      * @access public
    403      * @var string
    404      */
    405     public $type = 'nav_menus';
    406 
    407     /**
    408      * Render screen options for Menus.
    409      *
    410      * @since 4.3.0
    411      * @access public
    412      */
    413     public function render_screen_options() {
    414         // Essentially adds the screen options.
    415         add_filter( 'manage_nav-menus_columns', array( $this, 'wp_nav_menu_manage_columns' ) );
    416 
    417         // Display screen options.
    418         $screen = WP_Screen::get( 'nav-menus.php' );
    419         $screen->render_screen_options( array( 'wrap' => false ) );
    420     }
    421 
    422     /**
    423      * Returns the advanced options for the nav menus page.
    424      *
    425      * Link title attribute added as it's a relatively advanced concept for new users.
    426      *
    427      * @since 4.3.0
    428      * @access public
    429      *
    430      * @return array The advanced menu properties.
    431      */
    432     public function wp_nav_menu_manage_columns() {
    433         return array(
    434             '_title'      => __( 'Show advanced menu properties' ),
    435             'cb'          => '<input type="checkbox" />',
    436             'link-target' => __( 'Link Target' ),
    437             'attr-title'  => __( 'Title Attribute' ),
    438             'css-classes' => __( 'CSS Classes' ),
    439             'xfn'         => __( 'Link Relationship (XFN)' ),
    440             'description' => __( 'Description' ),
    441         );
    442     }
    443 
    444     /**
    445      * An Underscore (JS) template for this panel's content (but not its container).
    446      *
    447      * Class variables for this panel class are available in the `data` JS object;
    448      * export custom variables by overriding WP_Customize_Panel::json().
    449      *
    450      * @since 4.3.0
    451      * @access protected
    452      *
    453      * @see WP_Customize_Panel::print_template()
    454      */
    455     protected function content_template() {
    456         ?>
    457         <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>">
    458             <button type="button" class="customize-panel-back" tabindex="-1">
    459                 <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
    460             </button>
    461             <div class="accordion-section-title">
    462                 <span class="preview-notice">
    463                     <?php
    464                     /* Translators: %s is the site/panel title in the Customizer. */
    465                     printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
    466                     ?>
    467                 </span>
    468                 <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false">
    469                     <span class="screen-reader-text"><?php _e( 'Help' ); ?></span>
    470                 </button>
    471                 <button type="button" class="customize-screen-options-toggle" aria-expanded="false">
    472                     <span class="screen-reader-text"><?php _e( 'Menu Options' ); ?></span>
    473                 </button>
    474             </div>
    475             <# if ( data.description ) { #>
    476             <div class="description customize-panel-description">{{{ data.description }}}</div>
    477             <# } #>
    478             <div id="screen-options-wrap">
    479                 <?php $this->render_screen_options(); ?>
    480             </div>
    481         </li>
    482     <?php
    483     }
    484 }
     387/** WP_Customize_Nav_Menus_Panel class */
     388require_once( ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php' );
Note: See TracChangeset for help on using the changeset viewer.