From 8e5e7a3a1124cc9db3f4716beaf7a669e5218498 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 26 Mar 2024 01:25:11 +0000 Subject: [PATCH] Editor: Relocate font files uploads to the uploads directory. Relocate the upload of font files uploaded via the Font Library feature to the `wp-content/uploads/fonts` (or multisite equivalent) directory. This accounts for immutable file systems in which directories are unable to be created within `wp-content` and deploy processes which require special consideration of the `uploads` directory to ensure it remains persistent between deploys. Props azaozz, burnuser, cbirdsong, christopherplus, costdev, davidbaumwald, desrosj, elrae, euthelup, get_dave, grantmkin, hellofromtonya, janthiel, jazzs3quence, johnbillion, jorbin, justlevine, kraftner, matveb, mcsf, mmaattiiaass, nico23, peterwilsoncc, priethor, rmccue, samuelsidler, swissspidy, youknowriad. Fixes #60845. Built from https://develop.svn.wordpress.org/trunk@57878 git-svn-id: http://core.svn.wordpress.org/trunk@57379 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/fonts.php | 13 ++++--------- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/wp-includes/fonts.php b/wp-includes/fonts.php index 82085628d1..8ebd3849c3 100644 --- a/wp-includes/fonts.php +++ b/wp-includes/fonts.php @@ -167,17 +167,12 @@ function _wp_filter_font_directory( $font_dir ) { return $font_dir; } - $site_path = ''; - if ( is_multisite() && ! ( is_main_network() && is_main_site() ) ) { - $site_path = '/sites/' . get_current_blog_id(); - } - $font_dir = array( - 'path' => path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path, - 'url' => untrailingslashit( content_url( 'fonts' ) ) . $site_path, + 'path' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', + 'url' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'subdir' => '', - 'basedir' => path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path, - 'baseurl' => untrailingslashit( content_url( 'fonts' ) ) . $site_path, + 'basedir' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', + 'baseurl' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'error' => false, ); diff --git a/wp-includes/version.php b/wp-includes/version.php index fb6c70c180..7062772586 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.6-alpha-57877'; +$wp_version = '6.6-alpha-57878'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.