Changeset 56583
- Timestamp:
- 09/14/2023 11:23:59 AM (10 days ago)
- Location:
- trunk/src/wp-content/themes
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyeleven/functions.php
r56549 r56583 441 441 endif; // twentyeleven_admin_header_image() 442 442 443 444 if ( ! function_exists( 'twentyeleven_header_image' ) ) : 445 /** 446 * Custom header image markup displayed. 447 * 448 * @since Twenty Eleven 4.5 449 */ 450 function twentyeleven_header_image() { 451 $attrs = array( 452 'alt' => get_bloginfo( 'name', 'display' ), 453 ); 454 455 // Compatibility with versions of WordPress prior to 3.4. 456 if ( function_exists( 'get_custom_header' ) ) { 457 $custom_header = get_custom_header(); 458 $attrs['width'] = $custom_header->width; 459 $attrs['height'] = $custom_header->height; 460 } else { 461 $attrs['width'] = HEADER_IMAGE_WIDTH; 462 $attrs['height'] = HEADER_IMAGE_HEIGHT; 463 } 464 465 if ( function_exists( 'the_header_image_tag' ) ) { 466 the_header_image_tag( $attrs ); 467 return; 468 } 469 470 ?> 471 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $attrs['width'] ); ?>" height="<?php echo esc_attr( $attrs['height'] ); ?>" alt="<?php echo esc_attr( $attrs['alt'] ); ?>" /> 472 <?php 473 } 474 endif; // twentyeleven_header_image() 475 443 476 /** 444 477 * Set the post excerpt length to 40 words. -
trunk/src/wp-content/themes/twentyeleven/header.php
r56315 r56583 112 112 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 113 113 } else { 114 // Compatibility with versions of WordPress prior to 3.4. 115 if ( function_exists( 'get_custom_header' ) ) { 116 $header_image_width = get_custom_header()->width; 117 $header_image_height = get_custom_header()->height; 118 } else { 119 $header_image_width = HEADER_IMAGE_WIDTH; 120 $header_image_height = HEADER_IMAGE_HEIGHT; 121 } 122 ?> 123 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /> 124 <?php 114 twentyeleven_header_image(); 125 115 } // End check for featured image or standard header. 126 116 ?> -
trunk/src/wp-content/themes/twentyfourteen/header.php
r55276 r56583 37 37 <div id="site-header"> 38 38 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> 39 < img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />39 <?php twentyfourteen_header_image(); ?> 40 40 </a> 41 41 </div> -
trunk/src/wp-content/themes/twentyfourteen/inc/custom-header.php
r55420 r56583 152 152 } 153 153 endif; // twentyfourteen_admin_header_image() 154 155 156 if ( ! function_exists( 'twentyfourteen_header_image' ) ) : 157 /** 158 * Create the custom header image markup displayed. 159 * 160 * @see twentyfourteen_custom_header_setup() 161 * 162 * @since Twenty Fourteen 3.8 163 */ 164 function twentyfourteen_header_image() { 165 $custom_header = get_custom_header(); 166 $attrs = array( 167 'alt' => get_bloginfo( 'name', 'display' ), 168 'height' => $custom_header->height, 169 'width' => $custom_header->width, 170 ); 171 if ( function_exists( 'the_header_image_tag' ) ) { 172 the_header_image_tag( $attrs ); 173 return; 174 } 175 ?> 176 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $attrs['width'] ); ?>" height="<?php echo esc_attr( $attrs['height'] ); ?>" alt="<?php echo esc_attr( $attrs['alt'] ); ?>" /> 177 <?php 178 } 179 endif; // twentyfourteen_header_image() -
trunk/src/wp-content/themes/twentysixteen/header.php
r55276 r56583 103 103 <div class="header-image"> 104 104 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"> 105 <img src="<?php header_image(); ?>" srcset="<?php echo esc_attr( wp_get_attachment_image_srcset( get_custom_header()->attachment_id ) ); ?>" sizes="<?php echo esc_attr( $custom_header_sizes ); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /> 105 <?php 106 $custom_header = get_custom_header(); 107 $attrs = array( 108 'alt' => get_bloginfo( 'name', 'display' ), 109 'sizes' => $custom_header_sizes, 110 'height' => $custom_header->height, 111 'width' => $custom_header->width, 112 ); 113 114 the_header_image_tag( $attrs ); 115 ?> 106 116 </a> 107 117 </div><!-- .header-image --> -
trunk/src/wp-content/themes/twentyten/functions.php
r56315 r56583 291 291 endif; 292 292 293 294 if ( ! function_exists( 'twentyten_header_image' ) ) : 295 /** 296 * Custom header image markup displayed. 297 * 298 * @since Twenty Ten 4.0 299 */ 300 function twentyten_header_image() { 301 $attrs = array( 302 'alt' => get_bloginfo( 'name', 'display' ), 303 ); 304 305 // Compatibility with versions of WordPress prior to 3.4. 306 if ( function_exists( 'get_custom_header' ) ) { 307 $custom_header = get_custom_header(); 308 $attrs['width'] = $custom_header->width; 309 $attrs['height'] = $custom_header->height; 310 } else { 311 $attrs['width'] = HEADER_IMAGE_WIDTH; 312 $attrs['height'] = HEADER_IMAGE_HEIGHT; 313 } 314 315 if ( function_exists( 'the_header_image_tag' ) ) { 316 the_header_image_tag( $attrs ); 317 return; 318 } 319 320 ?> 321 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $attrs['width'] ); ?>" height="<?php echo esc_attr( $attrs['height'] ); ?>" alt="<?php echo esc_attr( $attrs['alt'] ); ?>" /> 322 <?php 323 } 324 endif; // twentyten_header_image() 325 293 326 /** 294 327 * Show a home link for our wp_nav_menu() fallback, wp_page_menu(). -
trunk/src/wp-content/themes/twentyten/header.php
r56315 r56583 96 96 echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' ); 97 97 } else { 98 // Compatibility with versions of WordPress prior to 3.4. 99 if ( function_exists( 'get_custom_header' ) ) { 100 $header_image_width = get_custom_header()->width; 101 $header_image_height = get_custom_header()->height; 102 } else { 103 $header_image_width = HEADER_IMAGE_WIDTH; 104 $header_image_height = HEADER_IMAGE_HEIGHT; 105 } 106 ?> 107 <img src="<?php header_image(); ?>" width="<?php echo esc_attr( $header_image_width ); ?>" height="<?php echo esc_attr( $header_image_height ); ?>" alt="" /> 108 <?php 98 twentyten_header_image(); 109 99 } // End check for featured image or standard header. 110 100 ?> -
trunk/src/wp-content/themes/twentytwelve/header.php
r54924 r56583 55 55 56 56 <?php if ( get_header_image() ) : ?> 57 <a href="<?php echo esc_url( home_url( '/' ) ); ?>">< img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>57 <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php twentytwelve_header_image(); ?></a> 58 58 <?php endif; ?> 59 59 </header><!-- #masthead --> -
trunk/src/wp-content/themes/twentytwelve/inc/custom-header.php
r55420 r56583 167 167 <?php 168 168 } 169 170 171 /** 172 * Output markup to be displayed. 173 * 174 * @since Twenty Twelve 4.1 175 */ 176 function twentytwelve_header_image() { 177 $custom_header = get_custom_header(); 178 $attrs = array( 179 'alt' => get_bloginfo( 'name', 'display' ), 180 'class' => 'header-image', 181 'height' => $custom_header->height, 182 'width' => $custom_header->width, 183 ); 184 185 if ( function_exists( 'the_header_image_tag' ) ) { 186 the_header_image_tag( $attrs ); 187 return; 188 } 189 ?> 190 <img src="<?php header_image(); ?>" class="<?php echo esc_attr( $attrs['class'] ); ?>" width="<?php echo esc_attr( $attrs['width'] ); ?>" height="<?php echo esc_attr( $attrs['height'] ); ?>" alt="<?php echo esc_attr( $attrs['alt'] ); ?>" /> 191 <?php 192 }
Note: See TracChangeset
for help on using the changeset viewer.