Is there a public PHP function that I call to regenerate the thumbnails for a specific image by passing the attachment's ID?
Is there a public PHP function that I call to regenerate the thumbnails for a specific image by passing the attachment's ID?
Yes, look at how the ajax_process_image() function in my plugin works.
Basically it's this though, although you should check for errors along the way (see function):
// Get path
$fullsizepath = get_attached_file( $image_ID );
// Generate meta data (this makes the thumbnail images)
$metadata = wp_generate_attachment_metadata( $image_ID, $fullsizepath );
// Save the meta data so WP knows the thumbs exist
wp_update_attachment_metadata( $image_ID, $metadata );You must log in to post.