font_dir
Filter HookDescription
Filters the fonts directory data. This filter allows developers to modify the fonts directory data. }Hook Information
File Location |
wp-includes/fonts.php
View on GitHub
|
Hook Type | Filter |
Line Number | 205 |
Hook Parameters
Type | Name | Description |
---|---|---|
array
|
$font_dir
|
{ Array of information about the font upload directory. |
Usage Examples
Basic Usage
<?php
// Hook into font_dir
add_filter('font_dir', 'my_custom_filter', 10, 1);
function my_custom_filter($font_dir) {
// Your custom filtering logic here
return $font_dir;
}
Source Code Context
wp-includes/fonts.php:205
- How this hook is used in WordPress core
<?php
200 * @type string $basedir Path without subdir.
201 * @type string $baseurl URL path without subdir.
202 * @type string|false $error False or error message.
203 * }
204 */
205 return apply_filters( 'font_dir', $font_dir );
206 }
207
208 /**
209 * Deletes child font faces when a font family is deleted.
210 *
PHP Documentation
<?php
/**
* Filters the fonts directory data.
*
* This filter allows developers to modify the fonts directory data.
*
* @since 6.5.0
*
* @param array $font_dir {
* Array of information about the font upload directory.
*
* @type string $path Base directory and subdirectory or full path to the fonts upload directory.
* @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory.
* @type string $subdir Subdirectory
* @type string $basedir Path without subdir.
* @type string $baseurl URL path without subdir.
* @type string|false $error False or error message.
* }
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/fonts.php
Related Hooks
Related hooks will be displayed here in future updates.