Changes in trunk/wp-includes/theme.php [14924:15235]
- File:
-
- 1 edited
-
trunk/wp-includes/theme.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r14924 r15235 629 629 } 630 630 } 631 @closedir($theme_subdir );631 @closedir($theme_subdirs); 632 632 if ( !$found_subdir_themes ) 633 633 $wp_broken_themes[$theme_dir] = array('Name' => $theme_dir, 'Title' => $theme_dir, 'Description' => __('Stylesheet is missing.')); … … 635 635 } 636 636 } 637 if ( is_dir( $theme_dir ) ) 638 @closedir( $theme_dir ); 637 @closedir( $themes_dir ); 639 638 } 640 639 return $theme_files; … … 1537 1536 $background = get_background_image(); 1538 1537 $color = get_background_color(); 1539 if ( ! $background && !$color )1538 if ( ! $background && ! $color ) 1540 1539 return; 1541 1540 1542 switch ( get_theme_mod('background_repeat', 'repeat') ) { 1543 case 'no-repeat': 1544 $repeat = 'background-repeat: no-repeat;'; 1545 break; 1546 case 'repeat-x': 1547 $repeat = 'background-repeat: repeat-x;'; 1548 break; 1549 case 'repeat-y': 1550 $repeat = 'background-repeat: repeat-y;'; 1551 break; 1552 default: 1553 $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; 1554 1562 } 1555 1556 switch ( get_theme_mod('background_position_x', 'left') ) {1557 case 'center':1558 $position = 'background-position: top center;';1559 break;1560 case 'right':1561 $position = 'background-position: top right;';1562 break;1563 default:1564 $position = 'background-position: top left;';1565 }1566 1567 if ( 'scroll' == get_theme_mod('background_attachment', 'fixed') )1568 $attachment = 'background-attachment: scroll;';1569 else1570 $attachment = 'background-attachment: fixed;';1571 1572 if ( !empty($background ) )1573 $image = "background-image: url('$background');";1574 else1575 $image = '';1576 1577 if ( !empty($color) )1578 $color = "background-color: #$color;";1579 else1580 $color = '';1581 1563 ?> 1582 1564 <style type="text/css"> 1583 body { 1584 <?php echo $image; ?> 1585 <?php echo $color; ?> 1586 <?php echo $repeat; ?> 1587 <?php echo $position; ?> 1588 <?php echo $attachment; ?> 1589 } 1565 body { <?php echo trim( $style ); ?> } 1590 1566 </style> 1591 1567 <?php
Note: See TracChangeset
for help on using the changeset viewer.