WordPress.org

Make WordPress Core

Ticket #30713: 30713.diff

File 30713.diff, 4.5 KB (added by celloexpressions, 6 years ago)

Render html classes for the entire sub-class tree's types, clean up core CSS selectors accordingly for media controls.

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

     
    580580/** Header control **/
    581581
    582582.customize-control-upload .current,
    583 .customize-control-image .current,
    584 .customize-control-background .current,
    585583.customize-control-header .current {
    586584        margin-bottom: 8px;
    587585}
     
    608606.customize-control-upload .remove-button,
    609607.customize-control-upload .default-button,
    610608.customize-control-upload .upload-button,
    611 .customize-control-image .remove-button,
    612 .customize-control-image .default-button,
    613 .customize-control-image .upload-button,
    614 .customize-control-background .remove-button,
    615 .customize-control-background .default-button,
    616 .customize-control-background .upload-button,
    617609.customize-control-header button.new,
    618610.customize-control-header button.remove {
    619611        white-space: normal;
     
    622614}
    623615
    624616.customize-control-upload .current .container,
    625 .customize-control-image .current .container,
    626 .customize-control-background .current .container,
    627617.customize-control-header .current .container {
    628618        overflow: hidden;
    629619        -webkit-border-radius: 2px;
     
    632622        border-radius: 2px;
    633623}
    634624
    635 .customize-control-upload .current .container,
    636 .customize-control-background .current .container,
    637 .customize-control-image .current .container {
     625.customize-control-upload .current .container {
    638626        min-height: 40px;
    639627}
    640628
    641629.customize-control-upload .placeholder,
    642 .customize-control-image .placeholder,
    643 .customize-control-background .placeholder,
    644630.customize-control-header .placeholder {
    645631        width: 100%;
    646632        position: relative;
     
    649635}
    650636
    651637.customize-control-upload .inner,
    652 .customize-control-image .inner,
    653 .customize-control-background .inner,
    654638.customize-control-header .inner {
    655639        display: none;
    656640        position: absolute;
     
    661645        overflow: hidden;
    662646}
    663647
    664 .customize-control-upload .inner,
    665 .customize-control-background .inner,
    666 .customize-control-image .inner {
     648.customize-control-upload .inner {
    667649        display: block;
    668650        min-height: 40px;
    669651}
    670652
    671653.customize-control-upload .inner,
    672 .customize-control-image .inner,
    673 .customize-control-background .inner,
    674654.customize-control-header .inner,
    675655.customize-control-header .inner .dashicons {
    676656        line-height: 20px;
     
    786766}
    787767
    788768.customize-control-upload .actions,
    789 .customize-control-image .actions,
    790 .customize-control-background .actions,
    791769.customize-control-header .actions {
    792770        margin-bottom: 32px;
    793771}
     
    803781}
    804782
    805783.customize-control-upload img,
    806 .customize-control-image img,
    807 .customize-control-background img,
    808784.customize-control-header img {
    809785        width: 100%;
    810786        -webkit-border-radius: 2px;
     
    813789
    814790.customize-control-upload .remove-button,
    815791.customize-control-upload .default-button,
    816 .customize-control-image .remove-button,
    817 .customize-control-image .default-button,
    818 .customize-control-background .remove-button,
    819 .customize-control-background .default-button,
    820792.customize-control-header .remove {
    821793        float: left;
    822794        margin-right: 3px;
     
    823795}
    824796
    825797.customize-control-upload .upload-button,
    826 .customize-control-image .upload-button,
    827 .customize-control-background .upload-button,
    828798.customize-control-header .new {
    829799        float: right;
    830800}
  • src/wp-includes/class-wp-customize-control.php

     
    338338         * @since 3.4.0
    339339         */
    340340        protected function render() {
    341                 $id    = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
    342                 $class = 'customize-control customize-control-' . $this->type;
     341                $id      = 'customize-control-' . str_replace( '[', '-', str_replace( ']', '', $this->id ) );
     342                if ( ! get_parent_class( $this ) ) {
     343                        $classes = 'customize-control customize-control-' . $this->type;
     344                } else {
     345                        $classes = 'customize-control';
     346                        $class = $this;
     347                        while ( $parent = get_parent_class( $class ) ) {
     348                                if ( isset( $class->type ) ) {
     349                                        $classes .= ' customize-control-' . $class->type;
     350                                }
     351                                $class = new $parent( $this->manager, 'temp', array() );
     352                        }
     353                }
    343354
    344                 ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $class ); ?>">
     355                ?><li id="<?php echo esc_attr( $id ); ?>" class="<?php echo esc_attr( $classes ); ?>">
    345356                        <?php $this->render_content(); ?>
    346357                </li><?php
    347358        }