Bulk Image Uploader to create new post from each image [closed]

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; }

Images in upload folder with hexadecimal names

Testing the plugin provided in this Answer, I just saw that media_handle_sideload generates exactly this pattern, jpeg extension as well (instead of jpg). Following its path through the core, it seems that only the filter wp_handle_upload could be used for dealing with that. But a brief research shows an interesting use of wp_handle_upload_prefilter: Rename files … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)