WordPress.org

Support

Support » Plugins and Hacks » Regenerate Thumbnails » [Plugin: Regenerate Thumbnails] Call for specific attachment ID?

[Plugin: Regenerate Thumbnails] Call for specific attachment ID?

Viewing 1 replies (of 1 total)
  • Plugin Author Alex Mills (Viper007Bond)

    @viper007bond

    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 );
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Regenerate Thumbnails] Call for specific attachment ID?’ is closed to new replies.
Skip to toolbar