Ticket #25229: custom-background.diff
File custom-background.diff, 1.5 KB (added by , 11 years ago) |
---|
-
wp-admin/custom-background.php
386 386 $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' ); 387 387 set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) ); 388 388 389 /** 390 * Fired after image is saved in media library, post meta is set, and image is set as theme background. 391 * 392 * @since Unknown 393 * 394 * @param string $file The local path to the uploaded file. 395 * @param int $id The post ID of the uploaded image. 396 */ 389 397 do_action('wp_create_file_in_uploads', $file, $id); // For replication 390 398 $this->updated = true; 391 399 } … … 411 419 public function wp_set_background_image() { 412 420 if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit; 413 421 $attachment_id = absint($_POST['attachment_id']); 422 /** 423 * Allows adding and editing of images sizes that can be chosen in the admin. 424 * 425 * @since Unknown 426 * 427 * @param array { 428 * An array of all of the image size names that can be selected in the admin. 429 * @type string The name of a new image size or a modified version of a current image size name. 430 * } 431 */ 414 432 $sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) )); 415 433 $size = 'thumbnail'; 416 434 if ( in_array( $_POST['size'], $sizes ) )