Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

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

    r42031 r42343  
    7676    public function to_json() {
    7777        parent::to_json();
    78         $this->json['label'] = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );
    79         $this->json['mime_type'] = $this->mime_type;
     78        $this->json['label']         = html_entity_decode( $this->label, ENT_QUOTES, get_bloginfo( 'charset' ) );
     79        $this->json['mime_type']     = $this->mime_type;
    8080        $this->json['button_labels'] = $this->button_labels;
    81         $this->json['canUpload'] = current_user_can( 'upload_files' );
     81        $this->json['canUpload']     = current_user_can( 'upload_files' );
    8282
    8383        $value = $this->value();
     
    8787                // Fake an attachment model - needs all fields used by template.
    8888                // Note that the default value must be a URL, NOT an attachment ID.
    89                 $type = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';
     89                $type               = in_array( substr( $this->setting->default, -3 ), array( 'jpg', 'png', 'gif', 'bmp' ) ) ? 'image' : 'document';
    9090                $default_attachment = array(
    91                     'id' => 1,
    92                     'url' => $this->setting->default,
    93                     'type' => $type,
    94                     'icon' => wp_mime_type_icon( $type ),
     91                    'id'    => 1,
     92                    'url'   => $this->setting->default,
     93                    'type'  => $type,
     94                    'icon'  => wp_mime_type_icon( $type ),
    9595                    'title' => basename( $this->setting->default ),
    9696                );
Note: See TracChangeset for help on using the changeset viewer.