WordPress.org

Make WordPress Core

Ticket #12186: theme.php.diff

File theme.php.diff, 1.4 KB (added by lancewillett, 8 years ago)

background color additions to theme.php

  • Applications/MAMP/htdocs/wordpress/wp/wp-includes/theme.php

     
    13421342 * @return string
    13431343 */
    13441344function get_background_image() {
    1345         $default =  defined('BACKGROUND_IMAGE') ? BACKGROUND_IMAGE : '';
     1345        $default = defined('BACKGROUND_IMAGE') ? BACKGROUND_IMAGE : '';
    13461346
    13471347        return get_theme_mod('background_image', $default);
    13481348}
     
    13571357}
    13581358
    13591359/**
     1360 * Retrieve value for custom background color.
     1361 *
     1362 * @since 3.0.0
     1363 * @uses BACKGROUND_COLOR
     1364 *
     1365 * @return string
     1366 */
     1367function get_background_color() {
     1368        $default = defined('BACKGROUND_COLOR') ? BACKGROUND_COLOR : '';
     1369
     1370        return get_theme_mod('background_color', $default);
     1371}
     1372
     1373/**
     1374 * Display background color value.
     1375 *
     1376 * @since 3.0.0
     1377 */
     1378function background_color() {
     1379        echo get_background_color();
     1380}
     1381
     1382/**
    13601383 * Add callbacks for background image display.
    13611384 *
    13621385 * The parameter $header_callback callback will be required to display the
     
    14201443?>
    14211444<style type="text/css">
    14221445body {
    1423         background-image:url('<?php background_image(); ?>');
     1446        background-color: #<?php background_color(); ?>;
     1447        background-image: url('<?php background_image(); ?>');
    14241448        <?php echo $repeat; ?>
    14251449        <?php echo $position; ?>
    14261450        <?php echo $attachment; ?>