From cf211ae8117adbdc844ddd70bef04301c01c094f Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:21:19 +1100 Subject: [PATCH] Document use of filter. --- src/wp-includes/fonts.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/fonts.php b/src/wp-includes/fonts.php index 41f65b1341571..74feee1ac9cf7 100644 --- a/src/wp-includes/fonts.php +++ b/src/wp-includes/fonts.php @@ -142,9 +142,19 @@ function wp_font_dir( $create_dir = true ) { /** * Returns the font directory for use by the font library. * - * This function is a callback for the 'upload_dir' filter. It is used not + * This function is a callback for the {@see 'upload_dir'} filter. It is not * intended to be called directly. Use wp_get_font_dir() instead. * + * The function can be used when extending the font library to modify the upload + * destination for font files via the upload_dir filter. The recommended way to + * do this is: + * + * ```php + * add_filter( 'upload_dir', '_wp_filter_font_directory' ); + * // Your code to upload or sideload a font file. + * remove_filter( 'upload_dir', '_wp_filter_font_directory' ); + * ``` + * * @since 6.5.0 * @access private *