wordpress/wp-content/themes/basic/themify/themify-fontello.php
/**
 * Gets the path to the Fontello assets
 * Extracts the uploaded package file automatically if necessary
 *
 * @return array|bool
 */
Gets the path to the Fontello assets
Extracts the uploaded package file automatically if necessary

@return array|bool
Gets the path to the Fontello assets Extracts the uploaded package file automatically if necessary @return array|bool
function themify_fontello_path() {
	if ( ! themify_check( 'setting-fontello' ) ) {
		return false;
	}
	$upload_dir = wp_upload_dir();
	$dest = trailingslashit( $upload_dir['basedir'] ) . 'fontello/';
	$path = themify_get( 'setting-fontello' );
	$base = preg_replace( '/(-\d+)?\.zip$/', '', basename( $path ) );
	if( is_dir( $dest . $base ) ) {
		$result = 1;
	} else { 
		$path = themify_get_absolute_path( $path );
		if ( $path === false ) {
			return false;
		}
		WP_Filesystem();
		$result = unzip_file( $path, $dest );
	}
	if( is_wp_error( $result ) || !is_dir( $dest . $base ) ) {
		return false;
	} elseif( 1 == $result ) {
		return array(
			'url' => trailingslashit( $upload_dir['baseurl'] ) . 'fontello/' . trailingslashit( $base ),
			'dir' => trailingslashit( $dest . $base )
		);
	}
}
function themify_fontello_path ( ) { if ( ! themify_check ( 'setting-fontello' ) ) { return false ; } $ upload_dir = wp_upload_dir ( ) ; $ dest = trailingslashit ( $ upload_dir [ 'basedir' ] ) . 'fontello/' ; $ path = themify_get ( 'setting-fontello' ) ; $ base = preg_replace ( '/(-\d+)?\.zip$/' , '' , basename ( $ path ) ) ; if ( is_dir ( $ dest . $ base ) ) { $ result = 1 ; } else { $ path = themify_get_absolute_path ( $ path ) ; if ( $ path === false ) { return false ; } WP_Filesystem ( ) ; $ result = unzip_file ( $ path , $ dest ) ; } if ( is_wp_error ( $ result ) || ! is_dir ( $ dest . $ base ) ) { return false ; } elseif ( 1 == $ result ) { return array ( 'url' => trailingslashit ( $ upload_dir [ 'baseurl' ] ) . 'fontello/' . trailingslashit ( $ base ) , 'dir' => trailingslashit ( $ dest . $ base ) ) ; } }
Gets the path to the Fontello assets
 Extracts the uploaded package file automatically if necessary
Gets the path to the Fontello assets Extracts the uploaded package file automatically if necessary
// -n suffix in the filename is added by WP, if multiple files of the same names are uploaded // directory exists // attempt to extract the file // get the system path from URL // could not get the file path, abort.