Support » Plugins and Hacks » [Plugin: WordPress Media Flickr] Fixed issue with file_get_contents

  • Resolved jeremyheslop


    I had an issue with the plugin because it was using file_get_contents (allow_url_fopen option in php.ini) which was turned off (blocked) by my hosting provider (1and1). I renamed the function to my_file_get_contents (on lines 31 and 35) and put this function at the top of the file wp-media-flickr.php:

    function my_file_get_contents($url) {
        $ch = curl_init();
        $timeout = 5; // set to zero for no timeout
        curl_setopt ($ch, CURLOPT_URL, $url);
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $file_contents = curl_exec($ch);
        return $file_contents;

    I was then able to authenticate and properly use the plugin when adding a post. Thanks for a great plugin.


  • The topic ‘[Plugin: WordPress Media Flickr] Fixed issue with file_get_contents’ is closed to new replies.