I have a function wp_handle_upload() for uploads files.
$file = $_FILES['attachment_icon-' . $i];
$upload = wp_handle_upload($file, array('test_form' => false));
what is a function for delete a uploaded file?
I have a function wp_handle_upload() for uploads files.
$file = $_FILES['attachment_icon-' . $i];
$upload = wp_handle_upload($file, array('test_form' => false));
what is a function for delete a uploaded file?
You must be logged in to post a comment.
Use
wp_delete_attachment( $post_id )
if you have usedwp_insert_attachment()
before.$post_id
is the attachment ID.If you havenât used
wp_insert_attachment()
a simple â¦â¦ will do it.
there is no designated WP function, simply because you already have a PHP one, with the following syntax:
for full doc see the PHP manual:
http://php.net/manual/en/function.unlink.php