Is there any plugin which creates a new post from each image I upload/select with it?

I want to create many posts with one image per post. Currently I select, upload all images. Then create new post, name it same as image file name, insert image from media library and then save to draft/publish it

add_action('add_attachment', 'create_post');
function create_post( $attach_ID ) {

    $attachment = get_post( $attach_ID );

    $my_post_data = array(
                'post_title' => $attachment->post_title,
                'post_type' => 'post',
                'post_category' => array('0'),
                'post_status' => 'publish'
    $post_id = wp_insert_post( $my_post_data );

    // attach media to post
    wp_update_post( array(
        'ID' => $attach_ID,
        'post_parent' => $post_id,
    ) );

    set_post_thumbnail( $post_id, $attach_ID );

    return $attach_ID;
| improve this answer | |

I've found a plugin named YAPB (Yet Another Photoblog) that does exactly what you need, in combination with YAPB Bulk Uploader. You can find the plugin and info here: http://wordpress.org/extend/plugins/yet-another-photoblog/

| improve this answer | |
  • Unfortunately the YAPB programmer took only half the way as YAPB creates it's own library and thumbnails - which leaves the user with an empty wordpress media library and without the possibility to (without coding) use the YAPB thumbs as post-thumbnail. As I understand it, the developer was aware of the flaw but abandoned the project before changing this in order to give users the opportunity of using the YAPB plugin without losing important benefit from the built in WordPress features by creating a box in the box. – Sven Knoch Nov 7 '12 at 16:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.