wp_handle_upload() does not list uploaded file in the media library?

Is it supposed to? My code:

if ($_POST && $_FILES) {
    $tmp_name = $_FILES['file']['tmp_name'];
    $item = $_FILES['file'];
    $uploads = wp_upload_dir();
    if (is_writable($uploads['path'])) {
        if (!empty($tmp_name))  {
            if ($tmp_name) {
                $overrides = array('test_form' => false);
                $file = wp_handle_upload($item, $overrides);
            }
        }
    }
}

Related posts

Leave a Reply

1 comment