Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (7 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/class-wp-customize-control.php

    r42034 r42343  
    214214
    215215        $this->manager = $manager;
    216         $this->id = $id;
     216        $this->id      = $id;
    217217        if ( empty( $this->active_callback ) ) {
    218218            $this->active_callback = array( $this, 'active_callback' );
     
    231231                $settings[ $key ] = $this->manager->get_setting( $setting );
    232232            }
    233         } else if ( is_string( $this->settings ) ) {
    234             $this->setting = $this->manager->get_setting( $this->settings );
     233        } elseif ( is_string( $this->settings ) ) {
     234            $this->setting       = $this->manager->get_setting( $this->settings );
    235235            $settings['default'] = $this->setting;
    236236        }
     
    254254    final public function active() {
    255255        $control = $this;
    256         $active = call_user_func( $this->active_callback, $this );
     256        $active  = call_user_func( $this->active_callback, $this );
    257257
    258258        /**
     
    309309        }
    310310
    311         $this->json['type'] = $this->type;
    312         $this->json['priority'] = $this->priority;
    313         $this->json['active'] = $this->active();
    314         $this->json['section'] = $this->section;
    315         $this->json['content'] = $this->get_content();
    316         $this->json['label'] = $this->label;
    317         $this->json['description'] = $this->description;
     311        $this->json['type']           = $this->type;
     312        $this->json['priority']       = $this->priority;
     313        $this->json['active']         = $this->active();
     314        $this->json['section']        = $this->section;
     315        $this->json['content']        = $this->get_content();
     316        $this->json['label']          = $this->label;
     317        $this->json['description']    = $this->description;
    318318        $this->json['instanceNumber'] = $this->instance_number;
    319319
     
    386386     */
    387387    final public function maybe_render() {
    388         if ( ! $this->check_capabilities() )
     388        if ( ! $this->check_capabilities() ) {
    389389            return;
     390        }
    390391
    391392        /**
     
    481482     */
    482483    protected function render_content() {
    483         $input_id = '_customize-input-' . $this->id;
    484         $description_id = '_customize-description-' . $this->id;
     484        $input_id         = '_customize-input-' . $this->id;
     485        $description_id   = '_customize-description-' . $this->id;
    485486        $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : '';
    486487        switch ( $this->type ) {
     
    514515                <?php endif; ?>
    515516                <?php if ( ! empty( $this->description ) ) : ?>
    516                     <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description ; ?></span>
     517                    <span id="<?php echo esc_attr( $description_id ); ?>" class="description customize-control-description"><?php echo $this->description; ?></span>
    517518                <?php endif; ?>
    518519
     
    583584
    584585                <?php
    585                 $dropdown_name = '_customize-dropdown-pages-' . $this->id;
    586                 $show_option_none = __( '&mdash; Select &mdash;' );
     586                $dropdown_name     = '_customize-dropdown-pages-' . $this->id;
     587                $show_option_none  = __( '&mdash; Select &mdash;' );
    587588                $option_none_value = '0';
    588                 $dropdown = wp_dropdown_pages(
     589                $dropdown          = wp_dropdown_pages(
    589590                    array(
    590591                        'name'              => $dropdown_name,
     
    596597                );
    597598                if ( empty( $dropdown ) ) {
    598                     $dropdown = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
     599                    $dropdown  = sprintf( '<select id="%1$s" name="%1$s">', esc_attr( $dropdown_name ) );
    599600                    $dropdown .= sprintf( '<option value="%1$s">%2$s</option>', esc_attr( $option_none_value ), esc_html( $show_option_none ) );
    600601                    $dropdown .= '</select>';
Note: See TracChangeset for help on using the changeset viewer.