get($url, array('filename' => $file_path, 'stream' => true)); print_r($result); if(is_wp_error($result)) { printf('
The information on this website is for the sole use of Toastmasters' members, for Toastmasters business only. It is not to be used for solicitation and distribution of non-Toastmasters material or information. All rights reserved. Toastmasters International, the Toastmasters International logo and all other Toastmasters International trademarks and copyrights are the sole property of Toastmasters International and may be used only by permission.
"http://toastmost.org/tmbranding/toastmasters.jpg", "toastmasters2.jpg" => "http://toastmost.org/tmbranding/toastmasters2.jpg", "toastmasters3.jpg" => "http://toastmost.org/tmbranding/toastmasters3.jpg", "toastmasters4.jpg" => "http://toastmost.org/tmbranding/toastmasters4.jpg", "toastmasters5.jpg" => "http://toastmost.org/tmbranding/toastmasters5.jpg", "toastmasters6.jpg" => "http://toastmost.org/tmbranding/toastmasters6.jpg", "toastmasters7.png" => "http://toastmost.org/tmbranding/toastmasters7.png", "toastmasters8.png" => "http://toastmost.org/tmbranding/toastmasters8.png", "toastmasters9.png" => "http://toastmost.org/tmbranding/toastmasters9.png", "toastmasters10.png" => "http://toastmost.org/tmbranding/toastmasters10.png", "toastmasters11.png" => "http://toastmost.org/tmbranding/toastmasters11.png", "toastmasters12.png" => "http://toastmost.org/tmbranding/toastmasters12.png", "toastmasters13.png" => "http://toastmost.org/tmbranding/toastmasters13.png", "toastmasters14.png" => "http://toastmost.org/tmbranding/toastmasters14.png", "toastmasters15.png" => "http://toastmost.org/tmbranding/toastmasters15.png", ); } function grab_tm_images ($basename) { $tm_images = get_tm_images(); // Get the path to the upload directory. $wp_upload_dir = wp_upload_dir(); /** * Perform a HTTP HEAD or GET request. * * If $file_path is a writable filename, this will do a GET request and write * the file to that path. * * @since 2.5.0 * * @param string $url URL to fetch. * @param string|bool $file_path Optional. File path to write request to. Default false. * @param int $red Optional. The number of Redirects followed, Upon 5 being hit, * returns false. Default 1. * @return bool|string False on failure and string of headers if HEAD request. */ $url = $tm_images[$basename]; if(!empty($url)) { $file_path = $wp_upload_dir["path"].'/'.$basename; $newurl = $wp_upload_dir['url'] . '/' . $basename; $myhttp = new WP_Http(); $result = $myhttp->get($url, array('filename' => $file_path, 'stream' => true)); if(is_wp_error($result)) { printf('