• It appears that media_sideload_image only half works. The image is downloaded to my server and stored in the /wp-content/uploads folder as I expect, but it’s not associated with a post and the site just gives me a blank page instead of moving forward.

    Here is a simplified example to test:

    if (is_page('Upp')){
        require_once(ABSPATH . 'wp-admin/includes/file.php');
        require_once(ABSPATH . 'wp-admin/includes/media.php');
        set_time_limit(300);
        $upload = media_sideload_image("https://29.media.tumblr.com/tumblr_lmp1tbiYwh1qzlfumo1_500.jpg", "202", "my description");
    //media_sideload_image(url,postID,description)
        die ( $upload );
    }

    What am I doing wrong here?

    Thanks,
    Dennis

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘media_sideload_image doesn't attach image to post’ is closed to new replies.