Last thumbnail:
![]()
If you find this plugin useful, I'd be happy to read your comments on the plugin homepage.
If you experience any problems, feel free to leave a comment too.
'attachment',
'post_mime_type' => 'image',
'numberposts' => -1,
'post_status' => null,
'post_parent' => null, // any parent
'output' => 'object',
) );
foreach ( $attachments as $attachment ) {
$res[] = array('id' => $attachment->ID, 'title' => $attachment->post_title);
}
die( json_encode($res) );
} else if ($action == "regen") {
$id = $_POST["id"];
$fullsizepath = get_attached_file( $id );
if ( FALSE !== $fullsizepath && @file_exists($fullsizepath) ) {
set_time_limit( 30 );
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $fullsizepath ) );
}
die( wp_get_attachment_thumb_url( $id ));
}
}
add_action( 'plugins_loaded', create_function( '', 'global $AjaxThumbnailRebuild; $AjaxThumbnailRebuild = new AjaxThumbnailRebuild();' ) );
?>