Make WordPress Core

Ticket #12186: 12186.diff

File 12186.diff, 3.4 KB (added by dd32, 15 years ago)

Note: Patch contains extra junk which doesnt affect functionality.

  • wp-admin/custom-background.php

     
    9898                }
    9999
    100100                if ( isset($_POST['background-repeat']) ) {
    101                         if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat')) )
     101                        if ( in_array($_POST['background-repeat'], array('repeat', 'no-repeat', 'repeat-x', 'repeat-y')) )
    102102                                $repeat = $_POST['background-repeat'];
    103103                        else
    104104                                $repeat = 'repeat';
     
    192192
    193193<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Repeat' ); ?></span></legend>
    194194<label>
    195 <input name="background-repeat" type="radio" value="no-repeat" <?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> />
    196 <?php _e('No repeat') ?>
     195<select name="background-repeat">
     196        <option value="no-repeat" <?php selected('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> ><?php _e('No repeat') ?></option>
     197        <option value="repeat" <?php selected('repeat', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile') ?></option>
     198        <option value="repeat-x" <?php selected('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile Horizontally') ?></option>
     199        <option value="repeat-y" <?php selected('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile Vertically') ?></option>
     200</select>
    197201</label>
    198 <label>
    199 <input name="background-repeat" type="radio" value="repeat" <?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?> />
    200 <?php _e('Tile') ?>
    201 </label>
    202202</fieldset></td>
    203203
    204204<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Attachment' ); ?></span></legend>
  • wp-includes/theme.php

     
    14401440        if ( !$background && !$color )
    14411441                return;
    14421442
    1443         $repeat = get_theme_mod('background_repeat', 'repeat');
    1444         if ( 'no-repeat' == $repeat )
     1443        if ( 'no-repeat' == get_theme_mod('background_repeat', 'repeat') )
    14451444                $repeat = 'background-repeat: no-repeat;';
     1445        elseif( 'repeat-x' == $repeat )
     1446                $repeat = 'background-repeat: repeat-x;';
     1447        elseif( 'repeat-y' == $repeat )
     1448                $repeat = 'background-repeat: repeat-y;';
    14461449        else
    14471450                $repeat = 'background-repeat: repeat;';
    1448         $position = get_theme_mod('background_position', 'left');
    1449         if  ( 'center' == $position )
    1450                 $position = 'background-position: top center;';
    1451         elseif ( 'right' == $position )
    1452                 $position = 'background-position: top right;';
    1453         else
    1454                 $position = 'background-position: top left;';
    1455         $attachment = get_theme_mod('background_attachment', 'fixed');
    1456         if ( 'scroll' == $attachment )
     1451
     1452        switch ( get_theme_mod('background_position', 'left') ) {
     1453                case 'center':
     1454                        $position = 'background-position: top center;';
     1455                        break;
     1456                case 'right':
     1457                        $position = 'background-position: top right;';
     1458                        break;
     1459                default:
     1460                        $position = 'background-position: top left;';
     1461        }
     1462
     1463        if ( 'scroll' == get_theme_mod('background_attachment', 'fixed') )
    14571464                $attachment = 'background-attachment: scroll;';
    14581465        else
    14591466                $attachment = 'background-attachment: fixed;';
     
    14631470        else
    14641471                $image = '';
    14651472
    1466         if ( !empty($background ) )
    1467                 $image = "background-image: url('$background');";
    1468         else
    1469                 $image = '';
    1470 
    14711473        if ( !empty($color) )
    14721474                $color = "background-color: #$color;";
    14731475        else