fix: add require_once to `file.php`
This commit is contained in:
parent
7e01e39d13
commit
3b88491708
|
@ -104,7 +104,10 @@ class Media {
|
|||
* @return string the file path
|
||||
*/
|
||||
public function save_remote_file($url) {
|
||||
$filename = download_url($url, 900);
|
||||
// Include file.php
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
|
||||
$filename = \download_url($url, 900);
|
||||
if( is_wp_error($filename) ) {
|
||||
throw new \Exception( "[save_remote_file]:" . implode("\n", $filename->get_error_messages()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue