Changeset 13765
- Timestamp:
- 03/19/2010 09:33:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/custom-background.php
r13764 r13765 90 90 */ 91 91 function js_includes() { 92 $step = $this->step(); 93 94 if ( 1 == $step ) 95 wp_enqueue_script('farbtastic'); 92 wp_enqueue_script('farbtastic'); 96 93 } 97 94 … … 102 99 */ 103 100 function css_includes() { 104 $step = $this->step(); 105 106 if ( 1 == $step ) 107 wp_enqueue_style('farbtastic'); 101 wp_enqueue_style('farbtastic'); 108 102 } 109 103 … … 154 148 set_theme_mod('background_color', ''); 155 149 } 150 151 $this->updated = true; 156 152 } 157 153 … … 162 158 */ 163 159 function js() { 164 $step = $this->step(); 165 if ( 1 == $step ) 166 $this->js_1(); 160 $this->js_1(); 167 161 } 168 162 … … 235 229 <?php screen_icon(); ?> 236 230 <h2><?php _e('Custom Background'); ?></h2> 237 <?php if ( isset($_GET['updated']) && $_GET['updated']) { ?>231 <?php if ( !empty($this->updated) ) { ?> 238 232 <div id="message" class="updated"> 239 233 <p><?php printf(__('Background updated. <a href="%s">Visit your site</a> to see how it looks.'), home_url()); ?></p> 240 234 </div> 241 <?php } 242 243 if ( get_background_image() || get_background_color() ) { ?> 235 <?php } ?> 244 236 <p><?php _e('This is your current background.'); ?></p> 245 237 <?php … … 257 249 <?php } ?> 258 250 </div> 259 <?php } 260 } else { ?> 261 <p><?php _e('There is currently no background image.'); ?></p> <?php 262 } 263 264 if ( get_background_image() ) : ?> 265 251 <?php } ?> 266 252 <h3><?php _e('Change Display Options') ?></h3> 267 253 <form method="post" action="<?php echo esc_attr(add_query_arg('step', 1)) ?>"> … … 328 314 </form> 329 315 330 <?php endif; ?>331 332 316 <h3><?php _e('Upload New Background Image'); ?></h3> 333 317 <form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo esc_attr(add_query_arg('step', 2)) ?>"> … … 364 348 365 349 if ( isset($file['error']) ) 366 die( $file['error'] );350 wp_die( $file['error'] ); 367 351 368 352 $url = $file['url']; … … 373 357 // Construct the object array 374 358 $object = array( 375 'post_title' => $filename, 376 'post_content' => $url, 377 'post_mime_type' => $type, 378 'guid' => $url); 359 'post_title' => $filename, 360 'post_content' => $url, 361 'post_mime_type' => $type, 362 'guid' => $url 363 ); 379 364 380 365 // Save the data … … 386 371 set_theme_mod('background_image', esc_url($url)); 387 372 do_action('wp_create_file_in_uploads', $file, $id); // For replication 373 $this->updated = true; 388 374 return $this->finished(); 389 375 } … … 395 381 */ 396 382 function finished() { 397 $_GET['updated'] = 1; 398 $this->step_1(); 383 $this->step_1(); 399 384 } 400 385
Note: See TracChangeset
for help on using the changeset viewer.