Make WordPress Core

Ticket #28504: 28504.panels.diff

File 28504.panels.diff, 2.1 KB (added by celloexpressions, 10 years ago)

Icons for panels only, using same API as the sections approach.

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

     
    145145        content: "\f141";
    146146}
    147147
     148.control-section.control-panel > .accordion-section-title {
     149        padding-left: 45px;
     150}
     151
     152.control-section.control-panel > .accordion-section-title:before {
     153        font: normal 20px/1 dashicons;
     154        position: absolute;
     155        top: 11px;
     156        left: 14px;
     157        -webkit-font-smoothing: antialiased;
     158        -moz-osx-font-smoothing: grayscale;
     159}
     160
     161/* Don't override custom icons, which get an additional class. */
     162.control-section.control-panel > [class="accordion-section-title "]:before {
     163        content: "\f111";
     164}
     165
     166#accordion-panel-widgets > .accordion-section-title:before {
     167        content: "\f116";
     168}
     169
     170#accordion-panel-menus > .accordion-section-title:before {
     171        content: "\f333";
     172}
     173
    148174.accordion-sub-container.control-panel-content {
    149175        display: none;
    150176        position: absolute;
  • src/wp-includes/class-wp-customize-section.php

     
    215215         */
    216216        public $sections;
    217217
     218        /**
     219         * Icon for the panel to show in UI.
     220         *
     221         * @since 4.0.0
     222         * @access public
     223         * @var string
     224         */
     225        public $icon = '';
     226
    218227        /**
    219228         * Constructor.
    220229         *
     
    243252         */
    244253        protected function render() {
    245254                ?>
    246                 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section">
    247                         <h3 class="accordion-section-title" tabindex="0">
     255                <li id="accordion-panel-<?php echo esc_attr( $this->id ); ?>" class="control-section control-panel accordion-section">
     256                        <h3 class="accordion-section-title <?php echo esc_attr( $this->icon ); ?>" tabindex="0">
    248257                                <?php echo esc_html( $this->title ); ?>
    249258                                <span class="screen-reader-text"><?php _e( 'Press return or enter to open panel' ); ?></span>
    250259                        </h3>