Ticket #12186: 12186.diff
File 12186.diff, 3.4 KB (added by , 15 years ago) |
---|
-
wp-admin/custom-background.php
98 98 } 99 99 100 100 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')) ) 102 102 $repeat = $_POST['background-repeat']; 103 103 else 104 104 $repeat = 'repeat'; … … 192 192 193 193 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Repeat' ); ?></span></legend> 194 194 <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> 197 201 </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>202 202 </fieldset></td> 203 203 204 204 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Attachment' ); ?></span></legend> -
wp-includes/theme.php
1440 1440 if ( !$background && !$color ) 1441 1441 return; 1442 1442 1443 $repeat = get_theme_mod('background_repeat', 'repeat'); 1444 if ( 'no-repeat' == $repeat ) 1443 if ( 'no-repeat' == get_theme_mod('background_repeat', 'repeat') ) 1445 1444 $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;'; 1446 1449 else 1447 1450 $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') ) 1457 1464 $attachment = 'background-attachment: scroll;'; 1458 1465 else 1459 1466 $attachment = 'background-attachment: fixed;'; … … 1463 1470 else 1464 1471 $image = ''; 1465 1472 1466 if ( !empty($background ) )1467 $image = "background-image: url('$background');";1468 else1469 $image = '';1470 1471 1473 if ( !empty($color) ) 1472 1474 $color = "background-color: #$color;"; 1473 1475 else