Automattic\WooCommerce\Internal\Font
FontFace::download_file()
Метод класса: FontFace{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$result = FontFace::download_file( $file_url );
- $file_url (обязательный)
- -
Код FontFace::download_file() FontFace::download file WC 9.6.1
private static function download_file( $file_url ) { if ( ! function_exists( 'download_url' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } $allowed_extensions = array( 'ttf', 'otf', 'woff', 'woff2', 'eot' ); $allowed_extensions = array_map( 'preg_quote', $allowed_extensions ); // Set variables for storage, fix file filename for query strings. preg_match( '/[^\?]+\.(' . implode( '|', $allowed_extensions ) . ')\b/i', $file_url, $matches ); $file_array = array(); $file_array['name'] = wp_basename( $matches[0] ); // Download file to temp location. $file_array['tmp_name'] = download_url( $file_url ); return $file_array; }