Make WordPress Core

Changeset 30567


Ignore:
Timestamp:
11/25/2014 03:11:11 PM (10 years ago)
Author:
iandstewart
Message:

Twenty Fifteen: remove unneeded custom header admin callbacks.

Props philiparthurmoore, fixes #30432.

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/css/admin-custom-header.css

    r30274 r30567  
    1 /*
    2 Theme Name: Twenty Fifteen
    3 Description: Used to style the header image displayed on the Appearance > Header screen.
    4 */
    5 
    6 .appearance_page_custom-header #headimg {
    7     background: #fff no-repeat 50% 50%;
    8     background-size: cover;
    9     border: none;
    10     box-sizing: border-box;
    11     padding: 7.6923%;
    12 }
    13 
    14 #headimg h1,
    15 #desc {
    16     color: #333;
    17     font-family: "Noto Sans", sans-serif;
    18 }
    19 
    20 #headimg h1 {
    21     font-size: 22px;
    22     line-height: 1.0909;
    23     margin: 0;
    24 }
    25 
    26 #headimg h1 a {
    27     text-decoration: none;
    28 }
    29 
    30 #desc {
    31     font-size: 12px;
    32     line-height: 1.5;
    33     margin-top: 0.5em;
    34     opacity: 0.7;
    35 }
    36 
    37 /* Hide the header text color option */
    38 .appearance_page_custom-header tr.displaying-header-text,
    39 .appearance_page_custom-header tr.displaying-header-text td,
    40 .appearance_page_custom-header tr.displaying-header-text th {
    41     display: none;
    42 }
    43 
    44 @media screen and (min-width: 772px) {
    45     #headimg h1 {
    46         font-size: 29px;
    47         line-height: 1.2069;
    48         margin: 0;
    49     }
    50 
    51     #desc {
    52         font-size: 14px;
    53     }
    54 }
    55 
    56 @media screen and (min-width: 783px) {
    57     #headimg h1 {
    58         font-size: 22px;
    59         line-height: 1.0909;
    60     }
    61 
    62     #desc {
    63         font-size: 12px;
    64         line-height: 1.5;
    65         margin-top: 0.5em;
    66     }
    67 }
    68 
    69 @media screen and (min-width: 1172px) {
    70     #headimg h1 {
    71         font-size: 29px;
    72         line-height: 1.2069;
    73     }
    74 
    75     #desc {
    76         font-size: 14px;
    77     }
    78 }
    79 
    80 @media screen and (min-width: 1313px) {
    81     #headimg h1 {
    82         font-size: 32px;
    83         line-height: 1.25;
    84     }
    85 
    86     #desc {
    87         font-size: 16px;
    88     }
    89 }
    90 
    91 @media screen and (min-width: 1383px) {
    92     .appearance_page_custom-header #headimg {
    93         background-position: 100% 50%;
    94         height: 1300px;
    95         max-width: 954px;
    96         padding: 83px 83px 0 0;
    97         width: 42%;
    98     }
    99 
    100     #headimg h1 {
    101         float: right;
    102         font-size: 27px;
    103         line-height: 1.1852;
    104         width: 248px;
    105     }
    106 
    107     #desc {
    108         clear: right;
    109         float: right;
    110         width: 248px;
    111     }
    112 }
  • trunk/src/wp-content/themes/twentyfifteen/inc/custom-header.php

    r30564 r30567  
    1212 *
    1313 * @uses twentyfifteen_header_style()
    14  * @uses twentyfifteen_admin_header_image()
    1514 */
    1615function twentyfifteen_custom_header_setup() {
     
    3130     *     @type string $wp-head-callback       Callback function used to styles the header image and text
    3231     *                                          displayed on the blog.
    33      *     @type string $admin-preview-callback Callback function used to create the custom header markup in
    34      *                                          the Appearance > Header screen.
    3532     * }
    3633     */
     
    4037        'height'                 => 1300,
    4138        'wp-head-callback'       => 'twentyfifteen_header_style',
    42         'admin-preview-callback' => 'twentyfifteen_admin_header_image',
    4339    ) ) );
    4440}
     
    173169}
    174170endif; // twentyfifteen_header_style
    175 
    176 if ( ! function_exists( 'twentyfifteen_admin_header_image' ) ) :
    177 /**
    178  * Custom header image markup displayed on the Appearance > Header admin panel.
    179  *
    180  * @since Twenty Fifteen 1.0
    181  * @see twentyfifteen_custom_header_setup().
    182  */
    183 function twentyfifteen_admin_header_image() {
    184     $style                   = sprintf( ' style="color: #%s;"', esc_attr( get_header_textcolor() ) );
    185     $color_scheme            = twentyfifteen_get_color_scheme();
    186     $header_background_color = get_theme_mod( 'header_background_color', $color_scheme[1] );
    187 ?>
    188     <div id="headimg" style="background-image: url(<?php header_image(); ?>); background-color: <?php echo esc_attr( $header_background_color ); ?>;">
    189         <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
    190         <div id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
    191     </div>
    192 <?php
    193 }
    194 endif; // twentyfifteen_admin_header_image
    195171
    196172/**
     
    375351}
    376352add_action( 'wp_enqueue_scripts', 'twentyfifteen_sidebar_text_color_css', 11 );
    377 
    378 /**
    379  * Enqueue styles to admin screen for custom header display.
    380  *
    381  * @since Twenty Fifteen 1.0
    382  */
    383 function twentyfifteen_admin_fonts() {
    384     wp_enqueue_style( 'twentyfifteen-fonts', twentyfifteen_fonts_url(), array(), null );
    385     wp_enqueue_style( 'twentyfifteen-custom-header', get_template_directory_uri() . '/css/admin-custom-header.css', array(), '20141010' );
    386 }
    387 add_action( 'admin_print_scripts-appearance_page_custom-header', 'twentyfifteen_admin_fonts' );
Note: See TracChangeset for help on using the changeset viewer.