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-content/themes/twentyfourteen/inc/custom-header.php

    r39226 r42343  
    3636     * }
    3737     */
    38     add_theme_support( 'custom-header', apply_filters( 'twentyfourteen_custom_header_args', array(
    39         'default-text-color'     => 'fff',
    40         'width'                  => 1260,
    41         'height'                 => 240,
    42         'flex-height'            => true,
    43         'wp-head-callback'       => 'twentyfourteen_header_style',
    44         'admin-head-callback'    => 'twentyfourteen_admin_header_style',
    45         'admin-preview-callback' => 'twentyfourteen_admin_header_image',
    46     ) ) );
     38    add_theme_support(
     39        'custom-header', apply_filters(
     40            'twentyfourteen_custom_header_args', array(
     41                'default-text-color'     => 'fff',
     42                'width'                  => 1260,
     43                'height'                 => 240,
     44                'flex-height'            => true,
     45                'wp-head-callback'       => 'twentyfourteen_header_style',
     46                'admin-head-callback'    => 'twentyfourteen_admin_header_style',
     47                'admin-preview-callback' => 'twentyfourteen_admin_header_image',
     48            )
     49        )
     50    );
    4751}
    4852add_action( 'after_setup_theme', 'twentyfourteen_custom_header_setup' );
    4953
    5054if ( ! function_exists( 'twentyfourteen_header_style' ) ) :
    51 /**
    52  * Styles the header image and text displayed on the blog
    53  *
    54  * @see twentyfourteen_custom_header_setup().
    55  *
    56  */
    57 function twentyfourteen_header_style() {
    58     $text_color = get_header_textcolor();
     55    /**
     56     * Styles the header image and text displayed on the blog
     57     *
     58     * @see twentyfourteen_custom_header_setup().
     59     */
     60    function twentyfourteen_header_style() {
     61        $text_color = get_header_textcolor();
    5962
    60     // If no custom color for text is set, let's bail.
    61     if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) )
    62         return;
     63        // If no custom color for text is set, let's bail.
     64        if ( display_header_text() && $text_color === get_theme_support( 'custom-header', 'default-text-color' ) ) {
     65            return;
     66        }
    6367
    64     // If we get this far, we have custom styles.
    65     ?>
    66     <style type="text/css" id="twentyfourteen-header-css">
    67     <?php
     68        // If we get this far, we have custom styles.
     69        ?>
     70        <style type="text/css" id="twentyfourteen-header-css">
     71        <?php
    6872        // Has the text been hidden?
    6973        if ( ! display_header_text() ) :
     
    8589    </style>
    8690    <?php
    87 }
     91    }
    8892endif; // twentyfourteen_header_style
    8993
    9094
    9195if ( ! function_exists( 'twentyfourteen_admin_header_style' ) ) :
    92 /**
    93  * Style the header image displayed on the Appearance > Header screen.
    94  *
    95  * @see twentyfourteen_custom_header_setup()
    96  *
    97  * @since Twenty Fourteen 1.0
    98  */
    99 function twentyfourteen_admin_header_style() {
    100 ?>
     96    /**
     97    * Style the header image displayed on the Appearance > Header screen.
     98    *
     99    * @see twentyfourteen_custom_header_setup()
     100    *
     101    * @since Twenty Fourteen 1.0
     102    */
     103    function twentyfourteen_admin_header_style() {
     104    ?>
    101105    <style type="text/css" id="twentyfourteen-admin-header-css">
    102106    .appearance_page_custom-header #headimg {
     
    123127    }
    124128    </style>
    125 <?php
    126 }
     129    <?php
     130    }
    127131endif; // twentyfourteen_admin_header_style
    128132
    129133if ( ! function_exists( 'twentyfourteen_admin_header_image' ) ) :
    130 /**
    131  * Create the custom header image markup displayed on the Appearance > Header screen.
    132  *
    133  * @see twentyfourteen_custom_header_setup()
    134  *
    135  * @since Twenty Fourteen 1.0
    136  */
    137 function twentyfourteen_admin_header_image() {
    138 ?>
     134    /**
     135    * Create the custom header image markup displayed on the Appearance > Header screen.
     136    *
     137    * @see twentyfourteen_custom_header_setup()
     138    *
     139    * @since Twenty Fourteen 1.0
     140    */
     141    function twentyfourteen_admin_header_image() {
     142    ?>
    139143    <div id="headimg">
    140144        <?php if ( get_header_image() ) : ?>
     
    144148    </div>
    145149<?php
    146 }
     150    }
    147151endif; // twentyfourteen_admin_header_image
Note: See TracChangeset for help on using the changeset viewer.