Title: font_dir
Published: April 3, 2024
Last modified: February 24, 2026

---

# apply_filters( ‘font_dir’, array $font_dir )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#wp--skip-link--target)

Filters the fonts directory data.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#description)󠁿

This filter allows developers to modify the fonts directory data.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#parameters)󠁿

 `$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.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#source)󠁿

    ```php
    return apply_filters( 'font_dir', $font_dir );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/fonts.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/fonts.php#L205)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/fonts.php#L205-L205)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#related)󠁿

| Used by | Description | 
| [_wp_filter_font_directory()](https://developer.wordpress.org/reference/functions/_wp_filter_font_directory/)`wp-includes/fonts.php` |

A callback function for use in the [‘upload_dir’](https://developer.wordpress.org/reference/hooks/upload_dir/) filter.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/font_dir/?output_format=md#changelog)󠁿

| Version | Description | 
| [6.5.0](https://developer.wordpress.org/reference/since/6.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Ffont_dir%2F)
before being able to contribute a note or feedback.