Make WordPress Core

Changeset 13668


Ignore:
Timestamp:
03/11/2010 08:21:58 PM (14 years ago)
Author:
ryan
Message:

Custom background color fixes. see #12186

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r13620 r13668  
    36603660}
    36613661
     3662#custom-background-image {
     3663    max-width: 400px;
     3664    max-height: 200px;
     3665}
     3666
    36623667div#custom-background-image img {
    36633668    max-width: 400px;
  • trunk/wp-admin/custom-background.php

    r13574 r13668  
    228228<?php screen_icon(); ?>
    229229<h2><?php _e('Custom Background'); ?></h2>
    230 <?php if ( get_background_image() ) { ?>
    231 <p><?php _e('This is your current background image.'); ?></p>
     230<?php if ( get_background_image() || get_background_color() ) { ?>
     231<p><?php _e('This is your current background.'); ?></p>
    232232<?php
    233233    if ( $this->admin_image_div_callback ) {
    234234        call_user_func($this->admin_image_div_callback);
    235235    } else {
     236        if ( $bgcolor = get_background_color() )
     237            $bgcolor = ' style="background-color: #' . $bgcolor . ';"';
     238        else
     239            $bgcolor = '';
    236240?>
    237 <div id="custom-background-image" style="background-color: #<?php background_color(); ?>;">
     241<div id="custom-background-image"<?php echo $bgcolor; ?>>
     242<?php if ( get_background_image() ) { ?>
    238243<img class="custom-background-image" src="<?php background_image(); ?>" />
     244<?php } ?>
    239245</div>
    240246<?php }
  • trunk/wp-includes/theme.php

    r13574 r13668  
    14371437function _custom_background_cb() {
    14381438    $background = get_background_image();
    1439 
    1440     if ( !$background )
     1439    $color = get_background_color();
     1440    if ( !$background && !$color )
    14411441        return;
    14421442
     
    14581458    else
    14591459        $attachment = 'background-attachment: fixed;';
     1460
     1461    if ( !empty($background ) )
     1462        $image = "background-image: url('$background');";
     1463    else
     1464        $image = '';
     1465
     1466    if ( !empty($background ) )
     1467        $image = "background-image: url('$background');";
     1468    else
     1469        $image = '';
     1470
     1471    if ( !empty($color) )
     1472        $color = "background-color: #$color;";
     1473    else
     1474        $color = '';
    14601475?>
    14611476<style type="text/css">
    14621477body {
    1463     background-color: #<?php background_color(); ?>;
    1464     background-image: url('<?php background_image(); ?>');
     1478    <?php echo $image; ?>
     1479    <?php echo $color; ?>
    14651480    <?php echo $repeat; ?>
    14661481    <?php echo $position; ?>
Note: See TracChangeset for help on using the changeset viewer.