font_dir filter-hookWP 6.5.0

Filters the fonts directory data.

This filter allows developers to modify the fonts directory data.

Usage

add_filter( 'font_dir', 'wp_kama_font_dir_filter' );

/**
 * Function for `font_dir` filter-hook.
 * 
 * @param array $font_dir Array of information about the font upload directory.
 *
 * @return array
 */
function wp_kama_font_dir_filter( $font_dir ){

	// filter...
	return $font_dir;
}
$font_dir(array)

Array of information about the font upload directory.

  • path(string)
    Base directory and subdirectory or full path to the fonts upload directory.

  • url(string)
    Base URL and subdirectory or absolute URL to the fonts upload directory.

  • subdir(string)
    Subdirectory

  • basedir(string)
    Path without subdir.

  • baseurl(string)
    URL path without subdir.

  • error(string|false)
    False or error message.

Changelog

Since 6.5.0 Introduced.

Where the hook is called

_wp_filter_font_directory()
font_dir
wp-includes/fonts.php 205
return apply_filters( 'font_dir', $font_dir );

Where the hook is used in WordPress

Usage not found.