Changeset 26878 for trunk/src/wp-admin/custom-background.php
- Timestamp:
- 12/29/2013 08:05:50 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/custom-background.php
r26594 r26878 180 180 ?> 181 181 <div class="wrap" id="custom-background"> 182 <h2><?php _e('Custom Background'); ?></h2> 183 <?php if ( !empty($this->updated) ) { ?> 182 <h2><?php _e( 'Custom Background' ); ?></h2> 183 184 <?php if ( ! empty( $this->updated ) ) { ?> 184 185 <div id="message" class="updated"> 185 186 <p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p> 186 187 </div> 187 <?php } 188 189 if ( $this->admin_image_div_callback ) { 190 call_user_func($this->admin_image_div_callback); 191 } else { 192 ?> 193 <h3><?php _e('Background Image'); ?></h3> 188 <?php } ?> 189 190 <h3><?php _e( 'Background Image' ); ?></h3> 191 194 192 <table class="form-table"> 195 193 <tbody> 196 194 <tr valign="top"> 197 <th scope="row"><?php _e( 'Preview'); ?></th>195 <th scope="row"><?php _e( 'Preview' ); ?></th> 198 196 <td> 199 <?php 200 $background_styles = ''; 201 if ( $bgcolor = get_background_color() ) 202 $background_styles .= 'background-color: #' . $bgcolor . ';'; 203 204 if ( get_background_image() ) { 205 $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); 206 // background-image URL must be single quote, see below 207 $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' 208 . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' 209 . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); 210 } 211 ?> 212 <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?> 213 <?php if ( get_background_image() ) { ?> 214 <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br /> 215 <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /> 216 <?php } ?> 217 </div> 218 <?php } ?> 197 <?php 198 if ( $this->admin_image_div_callback ) { 199 call_user_func( $this->admin_image_div_callback ); 200 } else { 201 $background_styles = ''; 202 if ( $bgcolor = get_background_color() ) 203 $background_styles .= 'background-color: #' . $bgcolor . ';'; 204 205 if ( get_background_image() ) { 206 $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) ); 207 // background-image URL must be single quote, see below 208 $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');' 209 . ' background-repeat: ' . get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ) . ';' 210 . ' background-position: top ' . get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); 211 } 212 ?> 213 <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?> 214 <?php if ( get_background_image() ) { ?> 215 <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br /> 216 <img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /> 217 <?php } ?> 218 </div> 219 <?php } ?> 219 220 </td> 220 221 </tr> 222 221 223 <?php if ( get_background_image() ) : ?> 222 224 <tr valign="top"> … … 244 246 </td> 245 247 </tr> 246 247 248 <?php endif; ?> 249 248 250 <tr valign="top"> 249 251 <th scope="row"><?php _e('Select Image'); ?></th>
Note: See TracChangeset
for help on using the changeset viewer.