Changeset 15196
- Timestamp:
- 06/10/2010 06:28:25 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-background.php
r15054 r15196 282 282 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend> 283 283 <label> 284 <input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', ' fixed')); ?> />284 <input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'scroll')); ?> /> 285 285 <?php _e('Scroll') ?> 286 286 </label> 287 287 <label> 288 <input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', ' fixed')); ?> />288 <input name="background-attachment" type="radio" value="fixed" <?php checked('fixed', get_theme_mod('background_attachment', 'scroll')); ?> /> 289 289 <?php _e('Fixed') ?> 290 290 </label> -
trunk/wp-includes/theme.php
r15167 r15196 1536 1536 $background = get_background_image(); 1537 1537 $color = get_background_color(); 1538 if ( ! $background && !$color )1538 if ( ! $background && ! $color ) 1539 1539 return; 1540 1540 1541 switch ( get_theme_mod('background_repeat', 'repeat') ) { 1542 case 'no-repeat': 1543 $repeat = 'background-repeat: no-repeat;'; 1544 break; 1545 case 'repeat-x': 1546 $repeat = 'background-repeat: repeat-x;'; 1547 break; 1548 case 'repeat-y': 1549 $repeat = 'background-repeat: repeat-y;'; 1550 break; 1551 default: 1552 $repeat = 'background-repeat: repeat;'; 1541 $style = $color ? "background-color: #$color;" : ''; 1542 1543 if ( $background ) { 1544 $image = " background-image: url('$background');"; 1545 1546 $repeat = get_theme_mod( 'background_repeat', 'repeat' ); 1547 if ( ! in_array( $repeat, array( 'no-repeat', 'repeat-x', 'repeat-y', 'repeat' ) ) ) 1548 $repeat = 'repeat'; 1549 $repeat = " background-repeat: $repeat;"; 1550 1551 $position = get_theme_mod( 'background_position_x', 'left' ); 1552 if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) 1553 $position = 'left'; 1554 $position = " background-position: top $position;"; 1555 1556 $attachment = get_theme_mod( 'background_attachment', 'scroll' ); 1557 if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) ) 1558 $attachment = 'scroll'; 1559 $attachment = " background-attachment: $attachment;"; 1560 1561 $style .= $image . $repeat . $position . $attachment; 1553 1562 } 1554 1555 switch ( get_theme_mod('background_position_x', 'left') ) {1556 case 'center':1557 $position = 'background-position: top center;';1558 break;1559 case 'right':1560 $position = 'background-position: top right;';1561 break;1562 default:1563 $position = 'background-position: top left;';1564 }1565 1566 if ( 'scroll' == get_theme_mod('background_attachment', 'fixed') )1567 $attachment = 'background-attachment: scroll;';1568 else1569 $attachment = 'background-attachment: fixed;';1570 1571 if ( !empty($background ) )1572 $image = "background-image: url('$background');";1573 else1574 $image = '';1575 1576 if ( !empty($color) )1577 $color = "background-color: #$color;";1578 else1579 $color = '';1580 1563 ?> 1581 1564 <style type="text/css"> 1582 body { 1583 <?php echo $image; ?> 1584 <?php echo $color; ?> 1585 <?php echo $repeat; ?> 1586 <?php echo $position; ?> 1587 <?php echo $attachment; ?> 1588 } 1565 body { <?php echo trim( $style ); ?> } 1589 1566 </style> 1590 1567 <?php
Note: See TracChangeset
for help on using the changeset viewer.