wp_font_dir()WP 6.5.0

Returns an array containing the current fonts upload directory's path and URL.

No Hooks.

Return

Array. Array of information about the font upload directory.

Usage

wp_font_dir( $create_dir );
$create_dir(true|false)
Whether to check and create the font uploads directory.
Default: true

Changelog

Since 6.5.0 Introduced.

wp_font_dir() code WP 6.5.4

function wp_font_dir( $create_dir = true ) {
	/*
	 * Allow extenders to manipulate the font directory consistently.
	 *
	 * Ensures the upload_dir filter is fired both when calling this function
	 * directly and when the upload directory is filtered in the Font Face
	 * REST API endpoint.
	 */
	add_filter( 'upload_dir', '_wp_filter_font_directory' );
	$font_dir = wp_upload_dir( null, $create_dir, false );
	remove_filter( 'upload_dir', '_wp_filter_font_directory' );
	return $font_dir;
}