Fix for thumbnails category excerpt
-
Hey,
thanks for your great addon. You should change the way, attachments are inserted, because this will lead to thmubnailless zombies which can be a bit of a hassle if you use a theme which depends on thumbnails.
Simple fix:
After
$picture_id = wp_insert_attachment( $attachment, $mirror[ 'file' ] );
in line 695
insert// Make sure that this file is included, as wp_generate_attachment_metadata() depends on it. require_once( ABSPATH . 'wp-admin/includes/image.php' ); // Generate the metadata for the attachment, and update the database record. $attach_data = wp_generate_attachment_metadata( $picture_id, $mirror[ 'file' ] ); wp_update_attachment_metadata( $picture_id, $attach_data );
in line 657 change
'post_excerpt' => $post_excerpt,
to
'post_content' => $post_excerpt,
so that themes can strip down the content for themselves. Better would be to add an option how many chars of the imported message should be inserted as an excerpt.Furtheron you’ve forgotten to insert the correct category. I’ve hardcoded it for myself with
'post_category' => array(11)
Maybe you can fix this in your next release.Kepp up the good work.
- The topic ‘Fix for thumbnails category excerpt’ is closed to new replies.