Ticket #15926: 15926.patch
File 15926.patch, 1.9 KB (added by , 14 years ago) |
---|
-
wp-admin/custom-header.php
205 205 if ( isset($this->default_headers[$_POST['default-header']]) ) 206 206 set_theme_mod('header_image', esc_url($this->default_headers[$_POST['default-header']]['url'])); 207 207 } 208 209 if ( isset( $_POST['alt-text'] ) ) { 210 check_admin_referer( 'custom-header-options', '_wpnonce-custom-header-options' ); 211 set_theme_mod( 'background_alt', esc_html( $_POST['alt-text'] ) ); 212 } 208 213 } 209 214 210 215 /** … … 494 499 ?> 495 500 </td> 496 501 </tr> 497 <?php endif; 498 499 if ( get_header_image() ) : ?> 502 <?php endif; ?> 500 503 <tr valign="top"> 504 <th scope="row"><?php _e( 'Alternative Text' ); ?></th> 505 <td> 506 <fieldset> 507 <legend class="screen-reader-text"> 508 <span><?php _e( 'Alternative Text' ); ?></span> 509 </legend> 510 <input type="text" name="alt-text" id="alt-text" value="<?php echo stripslashes( get_background_alt() ) ?>" /> 511 </fieldset></td> 512 </tr> 513 <?php if ( get_header_image() ) : ?> 514 <tr valign="top"> 501 515 <th scope="row"><?php _e( 'Remove Image' ); ?></th> 502 516 <td> 503 517 <p><?php _e( 'This will remove the header image. You will not be able to restore any customizations.' ) ?></p> -
wp-includes/theme.php
1544 1544 } 1545 1545 1546 1546 /** 1547 * Retrieve background image alt attribute for custom background. 1548 * 1549 * @uses BACKGROUND_ALT 1550 * 1551 * @return string 1552 */ 1553 function get_background_alt() { 1554 $default = defined('BACKGROUND_ALT') ? BACKGROUND_ALT : ''; 1555 1556 return get_theme_mod('background_alt', $default); 1557 } 1558 1559 /** 1560 * Display background image alt attribute. 1561 * 1562 * 1563 */ 1564 function background_alt() { 1565 echo get_background_alt(); 1566 } 1567 1568 /** 1547 1569 * Retrieve background image for custom background. 1548 1570 * 1549 1571 * @since 3.0.0