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
This commit is contained in:
parent
94aefe52dc
commit
0b0c456a44
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue