WordPress.org

Make WordPress Core

Ticket #18041: 18041.3.patch

File 18041.3.patch, 2.0 KB (added by lancewillett, 19 months ago)
  • wp-includes/theme.php

     
    16781678} 
    16791679 
    16801680/** 
     1681 * Retrieve background image thumbnail. 
     1682 * Uses defined background image path if theme_mod is empty. 
     1683 * 
     1684 * @since 3.3 
     1685 * 
     1686 * @return string 
     1687 */ 
     1688function get_background_image_thumb() { 
     1689        $default = defined( 'BACKGROUND_IMAGE' ) ? BACKGROUND_IMAGE : ''; 
     1690 
     1691        return get_theme_mod( 'background_image_thumb', $default ); 
     1692} 
     1693 
     1694/** 
    16811695 * Retrieve value for custom background color. 
    16821696 * 
    16831697 * @since 3.0.0 
  • wp-admin/custom-background.php

     
    196196 
    197197if ( get_background_image() ) { 
    198198        // background-image URL must be single quote, see below 
    199         $background_styles .= ' background-image: url(\'' . get_theme_mod('background_image_thumb', '') . '\');' 
     199        $background_styles .= ' background-image: url(\'' . get_background_image_thumb() . '\');' 
    200200                . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';' 
    201201                . ' background-position: top ' . get_theme_mod('background_position_x', 'left'); 
    202202} 
    203203?> 
    204204<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?> 
    205205<?php if ( get_background_image() ) { ?> 
    206 <img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" alt="" /><br /> 
    207 <img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" alt="" /> 
     206<img class="custom-background-image" src="<?php echo get_background_image_thumb(); ?>" style="visibility:hidden;" alt="" /><br /> 
     207<img class="custom-background-image" src="<?php echo get_background_image_thumb(); ?>" style="visibility:hidden;" alt="" /> 
    208208<?php } ?> 
    209209</div> 
    210210<?php } ?>