Ticket #22058: 22058.patch
File 22058.patch, 4.4 KB (added by , 12 years ago) |
---|
-
wp-admin/custom-background.php
151 151 if ( isset($_POST['background-position-x']) ) { 152 152 check_admin_referer('custom-background'); 153 153 if ( in_array($_POST['background-position-x'], array('center', 'right', 'left')) ) 154 $ position = $_POST['background-position-x'];154 $hposition = $_POST['background-position-x']; 155 155 else 156 $ position = 'left';157 set_theme_mod('background_position_x', $ position);156 $hposition = 'left'; 157 set_theme_mod('background_position_x', $hposition); 158 158 } 159 159 160 if ( isset($_POST['background-position-y']) ) { 161 check_admin_referer('custom-background'); 162 if ( in_array($_POST['background-position-y'], array('center', 'top', 'bottom')) ) 163 $vposition = $_POST['background-position-y']; 164 else 165 $vposition = 'top'; 166 set_theme_mod('background_position_y', $vposition); 167 } 168 160 169 if ( isset($_POST['background-attachment']) ) { 161 170 check_admin_referer('custom-background'); 162 171 if ( in_array($_POST['background-attachment'], array('fixed', 'scroll')) ) … … 213 222 // background-image URL must be single quote, see below 214 223 $background_styles .= ' background-image: url(\'' . set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ) . '\');' 215 224 . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';' 216 . ' background-position: top '. get_theme_mod('background_position_x', 'left');225 . ' background-position: ' . get_theme_mod('background_position_y', 'top') . get_theme_mod('background_position_x', 'left'); 217 226 } 218 227 ?> 219 228 <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?> … … 283 292 <tbody> 284 293 <?php if ( get_background_image() ) : ?> 285 294 <tr valign="top"> 286 <th scope="row"><?php _e( ' Position' ); ?></th>295 <th scope="row"><?php _e( 'Horizontal Position' ); ?></th> 287 296 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend> 288 297 <label> 289 298 <input name="background-position-x" type="radio" value="left"<?php checked('left', get_theme_mod('background_position_x', 'left')); ?> /> … … 301 310 </tr> 302 311 303 312 <tr valign="top"> 313 <th scope="row"><?php _e( 'Vertical Position' ); ?></th> 314 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Position' ); ?></span></legend> 315 <label> 316 <input name="background-position-y" type="radio" value="top"<?php checked('top', get_theme_mod('background_position_y', 'top')); ?> /> 317 <?php _e('Top') ?> 318 </label> 319 <label> 320 <input name="background-position-y" type="radio" value="center"<?php checked('center', get_theme_mod('background_position_y', 'top')); ?> /> 321 <?php _e('Center') ?> 322 </label> 323 <label> 324 <input name="background-position-y" type="radio" value="bottom"<?php checked('bottom', get_theme_mod('background_position_y', 'top')); ?> /> 325 <?php _e('Bottom') ?> 326 </label> 327 </fieldset></td> 328 </tr> 329 330 <tr valign="top"> 304 331 <th scope="row"><?php _e( 'Repeat' ); ?></th> 305 332 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend> 306 333 <label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?> /> <?php _e('No Repeat'); ?></label> -
wp-includes/theme.php
1139 1139 $repeat = 'repeat'; 1140 1140 $repeat = " background-repeat: $repeat;"; 1141 1141 1142 $position = get_theme_mod( 'background_position_x', 'left' ); 1143 if ( ! in_array( $position, array( 'center', 'right', 'left' ) ) ) 1144 $position = 'left'; 1145 $position = " background-position: top $position;"; 1142 $hposition = get_theme_mod( 'background_position_x', 'left' ); 1143 if ( ! in_array( $hposition, array( 'center', 'right', 'left' ) ) ) 1144 $hposition = 'left'; 1145 $vposition = get_theme_mod( 'background_position_y', 'top' ); 1146 if ( ! in_array( $vposition, array( 'center', 'top', 'bottom' ) ) ) 1147 $vposition = 'top'; 1148 $position = " background-position: $vposition $hposition;"; 1146 1149 1147 1150 $attachment = get_theme_mod( 'background_attachment', 'scroll' ); 1148 1151 if ( ! in_array( $attachment, array( 'fixed', 'scroll' ) ) )