Make WordPress Core

Ticket #25229: custom-background.diff

File custom-background.diff, 1.5 KB (added by dustyf, 11 years ago)

First pass at wp-admin/custom-background.php

  • wp-admin/custom-background.php

     
    386386                $thumbnail = wp_get_attachment_image_src( $id, 'thumbnail' );
    387387                set_theme_mod('background_image_thumb', esc_url_raw( $thumbnail[0] ) );
    388388
     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                 */
    389397                do_action('wp_create_file_in_uploads', $file, $id); // For replication
    390398                $this->updated = true;
    391399        }
     
    411419        public function wp_set_background_image() {
    412420                if ( ! current_user_can('edit_theme_options') || ! isset( $_POST['attachment_id'] ) ) exit;
    413421                $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                 */
    414432                $sizes = array_keys(apply_filters( 'image_size_names_choose', array('thumbnail' => __('Thumbnail'), 'medium' => __('Medium'), 'large' => __('Large'), 'full' => __('Full Size')) ));
    415433                $size = 'thumbnail';
    416434                if ( in_array( $_POST['size'], $sizes ) )