Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require_once( '../wp-admin/includes/image.php' );
- // Generate the metadata for the attachment, and update the database record.
- $attach_id = wp_insert_attachment( $idImagePostTable, $dirwpattached, $idPost );
- $attach_data = wp_generate_attachment_metadata( $attach_id, $dirwpattached );
- var_dump( wp_update_attachment_metadata( $attach_id, $attach_data ));
- echo "<br><pre>";print_r($attach_id.'-'.$attach_data);echo"</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement