Skip to content

Commit

Permalink
Remove infinite loop workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Mar 4, 2024
1 parent d7b3b99 commit 9cbad3e
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions files/class-vip-filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -468,13 +468,7 @@ public function filter_wp_read_image_metadata( $meta, $file ) {
* Changes the Font Library directory to work with the VIP Filesystem.
*/
public function filter_wp_font_dir( $defaults ) {
// Without removing the filter, there will be an infinite loop, because
// calling wp_upload_dir will trigger upload_dir, which includes wp_get_font_dir
// in the context of uploading fonts. That ultimately calls this function
// again through the font_dir filter.
remove_filter( 'upload_dir', 'wp_get_font_dir' );
$upload_dir = wp_upload_dir();
add_filter( 'upload_dir', 'wp_get_font_dir' );

$defaults['basedir'] = $upload_dir['basedir'] . '/fonts';
$defaults['baseurl'] = $upload_dir['baseurl'] . '/fonts';
Expand Down

0 comments on commit 9cbad3e

Please sign in to comment.