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/customize/class-wp-customize-header-image-setting.php

    r39411 r42343  
    3333        if ( empty( $custom_image_header ) ) {
    3434            require_once( ABSPATH . 'wp-admin/custom-header.php' );
    35             $args = get_theme_support( 'custom-header' );
    36             $admin_head_callback = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
     35            $args                   = get_theme_support( 'custom-header' );
     36            $admin_head_callback    = isset( $args[0]['admin-head-callback'] ) ? $args[0]['admin-head-callback'] : null;
    3737            $admin_preview_callback = isset( $args[0]['admin-preview-callback'] ) ? $args[0]['admin-preview-callback'] : null;
    38             $custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
     38            $custom_image_header    = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback );
    3939        }
    4040
    4141        // If the value doesn't exist (removed or random),
    4242        // use the header_image value.
    43         if ( ! $value )
    44             $value = $this->manager->get_setting('header_image')->post_value();
     43        if ( ! $value ) {
     44            $value = $this->manager->get_setting( 'header_image' )->post_value();
     45        }
    4546
    46         if ( is_array( $value ) && isset( $value['choice'] ) )
     47        if ( is_array( $value ) && isset( $value['choice'] ) ) {
    4748            $custom_image_header->set_header_image( $value['choice'] );
    48         else
     49        } else {
    4950            $custom_image_header->set_header_image( $value );
     51        }
    5052    }
    5153}
Note: See TracChangeset for help on using the changeset viewer.