Changeset 13856 for trunk/wp-admin/custom-background.php
- Timestamp:
- 03/28/2010 02:53:04 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-background.php
r13830 r13856 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 … … 150 150 call_user_func($this->admin_image_div_callback); 151 151 } else { 152 if ( $bgcolor = get_background_color() )153 $bgcolor = 'background-color: #' . $bgcolor . ';';154 155 if ( $align = get_theme_mod('background_position', 'left') )156 $align = "text-align: $align;";157 152 ?> 158 <div id="custom-background-image" style="<?php echo $bgcolor, $align ?>"> 153 154 <style type="text/css"> 155 #custom-background-image { 156 background-color: #<?php echo get_background_color()?>; 157 <?php if ( get_background_image() ) { ?> 158 background: url(<?php echo get_theme_mod('background_image_thumb', ''); ?>); 159 background-repeat: <?php echo get_theme_mod('background_repeat', 'no-repeat'); ?>; 160 background-position: top <?php echo get_theme_mod('background_position', 'left'); ?>; 161 background-attachment: <?php echo get_theme_mod('background_position', 'fixed'); ?>; 162 <?php } ?> 163 } 164 </style> 165 <div id="custom-background-image"> 159 166 <?php if ( get_background_image() ) { ?> 160 <img class="custom-background-image" src="<?php background_image(); ?>" /> 167 <img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" /><br /> 168 <img class="custom-background-image" src="<?php echo get_theme_mod('background_image_thumb', ''); ?>" style="visibility:hidden;" /> 161 169 <?php } ?> 162 170 <br class="clear" /> … … 193 201 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Repeat' ); ?></span></legend> 194 202 <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') ?>197 </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') ?>203 <select name="background-repeat"> 204 <option value="no-repeat" <?php selected('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> ><?php _e('No repeat'); ?></option> 205 <option value="repeat" <?php selected('repeat', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile'); ?></option> 206 <option value="repeat-x" <?php selected('repeat-x', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile Horizontally'); ?></option> 207 <option value="repeat-y" <?php selected('repeat-y', get_theme_mod('background_repeat', 'repeat')); ?>><?php _e('Tile Vertically'); ?></option> 208 </select> 201 209 </label> 202 210 </fieldset></td> … … 287 295 288 296 set_theme_mod('background_image', esc_url($url)); 297 298 $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' ); 299 set_theme_mod('background_image_thumb', esc_url( $thumbnail[0] ) ); 300 289 301 do_action('wp_create_file_in_uploads', $file, $id); // For replication 290 302 $this->updated = true;
Note: See TracChangeset
for help on using the changeset viewer.