Ticket #15926: final.patch
File final.patch, 3.6 KB (added by , 14 years ago) |
---|
-
wp-admin/custom-header.php
168 168 return; 169 169 170 170 $this->updated = true; 171 171 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); 172 172 if ( isset( $_POST['resetheader'] ) ) { 173 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );174 173 remove_theme_mod( 'header_image' ); 175 174 return; 176 175 } 177 176 178 177 if ( isset( $_POST['resettext'] ) ) { 179 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );180 178 remove_theme_mod('header_textcolor'); 181 179 return; 182 180 } 183 181 184 182 if ( isset( $_POST['removeheader'] ) ) { 185 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );186 183 set_theme_mod( 'header_image', '' ); 187 184 return; 188 185 } 189 186 190 187 if ( isset( $_POST['text-color'] ) ) { 191 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );192 188 $_POST['text-color'] = str_replace( '#', '', $_POST['text-color'] ); 193 189 if ( 'blank' == $_POST['text-color'] ) { 194 190 set_theme_mod( 'header_textcolor', 'blank' ); … … 200 196 } 201 197 202 198 if ( isset($_POST['default-header']) ) { 203 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' );204 199 $this->process_default_headers(); 205 200 if ( isset($this->default_headers[$_POST['default-header']]) ) 206 201 set_theme_mod('header_image', esc_url($this->default_headers[$_POST['default-header']]['url'])); 207 202 } 203 204 if ( isset($_POST['alt-text']) ) { 205 set_theme_mod('header_alt', esc_html($_POST['alt-text'])); 206 } 208 207 } 209 208 210 209 /** … … 498 497 499 498 if ( get_header_image() ) : ?> 500 499 <tr valign="top"> 500 <th scope="row"><?php _e( 'Alternative Text' ); ?></th> 501 <td> 502 <fieldset> 503 <legend class="screen-reader-text"> 504 <span><?php _e( 'Alternative Text' ); ?></span> 505 </legend> 506 <input type="text" name="alt-text" id="alt-text" value="<?php header_alt() ?>" /> 507 </fieldset></td> 508 </tr> 509 <tr valign="top"> 501 510 <th scope="row"><?php _e( 'Remove Image' ); ?></th> 502 511 <td> 503 512 <p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p> -
wp-content/themes/twentyten/header.php
74 74 // Houston, we have a new header image! 75 75 echo get_the_post_thumbnail( $post->ID ); 76 76 elseif ( get_header_image() ) : ?> 77 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="" />77 <img src="<?php header_image(); ?>" width="<?php echo HEADER_IMAGE_WIDTH; ?>" height="<?php echo HEADER_IMAGE_HEIGHT; ?>" alt="<?php header_alt(); ?>" /> 78 78 <?php endif; ?> 79 79 </div><!-- #branding --> 80 80 -
wp-includes/theme.php
1420 1420 } 1421 1421 1422 1422 /** 1423 * Retrieve background image alt attribute for custom background. 1424 * 1425 * @uses HEADER_ALT 1426 * 1427 * @return string 1428 */ 1429 function get_header_alt() { 1430 $default = defined('HEADER_ALT') ? HEADER_ALT : ''; 1431 1432 return get_theme_mod('header_alt', $default); 1433 } 1434 1435 /** 1436 * Display background image alt attribute. 1437 * 1438 * 1439 */ 1440 function header_alt() { 1441 echo get_header_alt(); 1442 } 1443 1444 /** 1423 1445 * Retrieve header image for custom header. 1424 1446 * 1425 1447 * @since 2.1.0