Make WordPress Core

Ticket #28504: 28504.2.diff

File 28504.2.diff, 6.8 KB (added by celloexpressions, 10 years ago)

Refresh, with support for panels and top-level sections, and adding icons to all core and bundled theme sections. A default icon is shown for sections without icons.

  • src/wp-admin/css/customize-controls.css

     
    268268        height: 22px;
    269269}
    270270
     271.control-section .accordion-section-title {
     272        padding-left: 45px;
     273}
     274
     275.in-sub-panel .control-section .accordion-section-title {
     276        padding-left: 14px;
     277}
     278
     279.control-section .accordion-section-title:before {
     280        font: normal 20px/1 dashicons;
     281        position: absolute;
     282        top: 11px;
     283        left: 14px;
     284        -webkit-font-smoothing: antialiased;
     285        -moz-osx-font-smoothing: grayscale;
     286}
     287
     288/* Don't override custom icons, which get an additional class. */
     289.control-panel > [class="accordion-section-title "]:before,
     290.control-section > [class="accordion-section-title "]:before {
     291        content: "\f111";
     292}
     293
    271294.wp-full-overlay-sidebar .wp-full-overlay-header {
    272295        -webkit-transition: padding ease-in-out .18s;
    273296        transition: padding ease-in-out .18s;
  • src/wp-content/themes/twentyeleven/inc/theme-options.php

     
    550550        // Default Layout
    551551        $wp_customize->add_section( 'twentyeleven_layout', array(
    552552                'title'    => __( 'Layout', 'twentyeleven' ),
     553                'icon'     => 'dashicons-align-right',
    553554                'priority' => 50,
    554555        ) );
    555556
  • src/wp-content/themes/twentyfourteen/inc/customizer.php

     
    3838        // Add the featured content section in case it's not already there.
    3939        $wp_customize->add_section( 'featured_content', array(
    4040                'title'       => __( 'Featured Content', 'twentyfourteen' ),
     41                'icon'        => 'dashicons-star-filled',
    4142                'description' => sprintf( __( 'Use a <a href="%1$s">tag</a> to feature your posts. If no posts match the tag, <a href="%2$s">sticky posts</a> will be displayed instead.', 'twentyfourteen' ),
    4243                        esc_url( add_query_arg( 'tag', _x( 'featured', 'featured content default tag slug', 'twentyfourteen' ), admin_url( 'edit.php' ) ) ),
    4344                        admin_url( 'edit.php?show_sticky=1' )
  • src/wp-includes/class-wp-customize-manager.php

     
    931931
    932932                $this->add_section( 'title_tagline', array(
    933933                        'title'    => __( 'Site Title & Tagline' ),
     934                        'icon'     => 'dashicons-feedback',
    934935                        'priority' => 20,
    935936                ) );
    936937
     
    960961
    961962                $this->add_section( 'colors', array(
    962963                        'title'          => __( 'Colors' ),
     964                        'icon'           => 'dashicons-art',
    963965                        'priority'       => 40,
    964966                ) );
    965967
     
    10051007
    10061008                $this->add_section( 'header_image', array(
    10071009                        'title'          => __( 'Header Image' ),
     1010                        'icon'           => 'dashicons-camera',
    10081011                        'theme_supports' => 'custom-header',
    10091012                        'priority'       => 60,
    10101013                ) );
     
    10251028
    10261029                $this->add_section( 'background_image', array(
    10271030                        'title'          => __( 'Background Image' ),
     1031                        'icon'           => 'dashicons-format-image',
    10281032                        'theme_supports' => 'custom-background',
    10291033                        'priority'       => 80,
    10301034                ) );
     
    11041108
    11051109                $this->add_section( 'nav', array(
    11061110                        'title'          => __( 'Navigation' ),
     1111                        'icon'           => 'dashicons-menu',
    11071112                        'theme_supports' => 'menus',
    11081113                        'priority'       => 100,
    11091114                        'description'    => sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . "\n\n" . __('You can edit your menu content on the Menus screen in the Appearance section.'),
     
    11371142
    11381143                $this->add_section( 'static_front_page', array(
    11391144                        'title'          => __( 'Static Front Page' ),
     1145                        'icon'           => 'dashicons-admin-post',
    11401146                //      'theme_supports' => 'static-front-page',
    11411147                        'priority'       => 120,
    11421148                        'description'    => __( 'Your theme supports a static front page.' ),
  • src/wp-includes/class-wp-customize-panel.php

     
    7474        public $description = '';
    7575
    7676        /**
     77         * Dasicon for this panel.
     78         *
     79         * @since 4.1.0
     80         * @access public
     81         * @var string
     82         */
     83        public $icon = '';
     84
     85        /**
    7786         * Customizer sections for this panel.
    7887         *
    7988         * @since 4.0.0
     
    170179        protected function render() {
    171180                ?>
    172181                <li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section">
    173                         <h3 class="accordion-section-title" tabindex="0">
     182                        <h3 class="accordion-section-title <?php echo $this->icon; ?>" tabindex="0">
    174183                                <?php echo esc_html( $this->title ); ?>
    175184                                <span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span>
    176185                        </h3>
  • src/wp-includes/class-wp-customize-section.php

     
    8383        public $description = '';
    8484
    8585        /**
     86         * Dasicon for the section.
     87         *
     88         * @since 4.1.0
     89         * @access public
     90         * @var string
     91         */
     92        public $icon = '';
     93
     94        /**
    8695         * Customizer controls for this section.
    8796         *
    8897         * @since 3.4.0
     
    177186                }
    178187                ?>
    179188                <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
    180                         <h3 class="accordion-section-title" tabindex="0">
     189                        <h3 class="accordion-section-title <?php echo $this->icon; ?>" tabindex="0">
    181190                                <?php echo esc_html( $this->title ); ?>
    182191                                <span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span>
    183192                        </h3>
  • src/wp-includes/class-wp-customize-widgets.php

     
    435435
    436436                $this->manager->add_panel( 'widgets', array(
    437437                        'title'       => __( 'Widgets' ),
     438                        'icon'        => 'dashicons-welcome-widgets-menus',
    438439                        'description' => __( 'Widgets are independent sections of content that can be placed into widgetized areas provided by your theme (commonly called sidebars).' ),
    439440                        'priority'    => 110,
    440441                ) );