Changeset 53027
- Timestamp:
- 03/29/2022 09:46:09 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r52978 r53027 3971 3971 $cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication. 3972 3972 3973 $parent_url = wp_get_attachment_url( $attachment_id ); 3974 $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); 3973 $parent_url = wp_get_attachment_url( $attachment_id ); 3974 $parent_basename = wp_basename( $parent_url ); 3975 $url = str_replace( $parent_basename, wp_basename( $cropped ), $parent_url ); 3975 3976 3976 3977 $size = wp_getimagesize( $cropped ); 3977 3978 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3979 3994 $object = array( 3980 'post_title' => wp_basename( $cropped ),3981 'post_content' => $u rl,3995 'post_title' => wp_basename( $cropped ), 3996 'post_content' => $url, 3982 3997 'post_mime_type' => $image_type, 3983 3998 'guid' => $url, 3984 3999 'context' => $context, 3985 4000 ); 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 3986 4013 3987 4014 $attachment_id = wp_insert_attachment( $object, $cropped );
Note: See TracChangeset
for help on using the changeset viewer.