如何在Wordpress中更改生成的缩略图?
有一段代码在上传到媒体后将exif geolaction添加到图像中。仅适用于主图片。如何将exif添加到生成的缩略图中如何在Wordpress中更改生成的缩略图?,wordpress,Wordpress,有一段代码在上传到媒体后将exif geolaction添加到图像中。仅适用于主图片。如何将exif添加到生成的缩略图中 add_filter('wp_handle_upload', 'add_geo_taging_for_images', 10, 2); public function add_geo_taging_for_images($upload, $context){ if ($upload['type'] == 'image/jpeg'){ $this-&g
add_filter('wp_handle_upload', 'add_geo_taging_for_images', 10, 2);
public function add_geo_taging_for_images($upload, $context){
if ($upload['type'] == 'image/jpeg'){
$this->addGpsInfo($upload['file'], 12.345, 67.890);
}
// not working
/*$attach_id = $this->get_attachment_id($upload['url']);
$attach_data = wp_generate_attachment_metadata( $attach_id, $upload['file'] );
wp_update_attachment_metadata( $attach_id, $attach_data );*/
return $upload;
}