Changeset 53137 for trunk/src/wp-admin/includes/class-wp-site-icon.php
- Timestamp:
- 04/11/2022 02:19:13 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-site-icon.php
r50146 r53137 81 81 * @param string $cropped Cropped image URL. 82 82 * @param int $parent_attachment_id Attachment ID of parent image. 83 * @return array A ttachment object.83 * @return array An array with attachment object data. 84 84 */ 85 85 public function create_attachment_object( $cropped, $parent_attachment_id ) { … … 91 91 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 92 92 93 $ object = array(93 $attachment = array( 94 94 'ID' => $parent_attachment_id, 95 95 'post_title' => wp_basename( $cropped ), … … 100 100 ); 101 101 102 return $ object;102 return $attachment; 103 103 } 104 104 … … 108 108 * @since 4.3.0 109 109 * 110 * @param array $ object Attachment object.111 * @param string $file File path of the attached image.112 * @return int Attachment ID113 */ 114 public function insert_attachment( $ object, $file ) {115 $attachment_id = wp_insert_attachment( $ object, $file );110 * @param array $attachment An array with attachment object data. 111 * @param string $file File path of the attached image. 112 * @return int Attachment ID. 113 */ 114 public function insert_attachment( $attachment, $file ) { 115 $attachment_id = wp_insert_attachment( $attachment, $file ); 116 116 $metadata = wp_generate_attachment_metadata( $attachment_id, $file ); 117 117
Note: See TracChangeset
for help on using the changeset viewer.