From 0b0c456a4443052b4a3d1210daa2aea9b53f368a Mon Sep 17 00:00:00 2001 From: Konstantin Obenland <obenland@automattic.com> Date: Mon, 27 Jul 2015 16:09:25 +0000 Subject: [PATCH] Site Icon: Minor cleanup for `WP_Site_Icon` after [33329]. Built from https://develop.svn.wordpress.org/trunk@33446 git-svn-id: http://core.svn.wordpress.org/trunk@33413 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-site-icon.php | 22 +++++----------------- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/wp-admin/includes/class-wp-site-icon.php b/wp-admin/includes/class-wp-site-icon.php index d3578d812f..c71845936e 100644 --- a/wp-admin/includes/class-wp-site-icon.php +++ b/wp-admin/includes/class-wp-site-icon.php @@ -65,7 +65,7 @@ class WP_Site_Icon { * @access public */ public function __construct() { - add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ), 10, 1 ); + add_action( 'delete_attachment', array( $this, 'delete_attachment_data' ) ); add_filter( 'get_post_metadata', array( $this, 'get_post_metadata' ), 10, 4 ); } @@ -110,21 +110,7 @@ class WP_Site_Icon { */ public function insert_attachment( $object, $file ) { $attachment_id = wp_insert_attachment( $object, $file ); - $this->update_attachment_metadata( $attachment_id, $file ); - - return $attachment_id; - } - - /** - * Handles updating the metadata of an attachment. - * - * @since 4.3.0 - * - * @param int $attachment_id Attachment ID - * @param string $file File path of the attached image. - */ - public function update_attachment_metadata( $attachment_id, $file ) { - $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); + $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); /** * Filter the site icon attachment metadata. @@ -137,6 +123,8 @@ class WP_Site_Icon { */ $metadata = apply_filters( 'site_icon_attachment_metadata', $metadata ); wp_update_attachment_metadata( $attachment_id, $metadata ); + + return $attachment_id; } /** @@ -194,7 +182,7 @@ class WP_Site_Icon { * @return array List of intermediate image sizes. */ public function intermediate_image_sizes( $sizes = array() ) { - /** This filter is documented in wp-admin/includes/site-icon.php */ + /** This filter is documented in wp-admin/includes/class-wp-site-icon.php */ $this->site_icon_sizes = apply_filters( 'site_icon_image_sizes', $this->site_icon_sizes ); foreach ( $this->site_icon_sizes as $size ) { $sizes[] = 'site_icon-' . $size; diff --git a/wp-includes/version.php b/wp-includes/version.php index 40b76f66d6..d3ed1198bc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta4-33445'; +$wp_version = '4.3-beta4-33446'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.