Make WordPress Core


Ignore:
Timestamp:
03/26/2024 01:23:14 AM (3 years ago)
Author:
peterwilsoncc
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/fonts.php

    r57871 r57878  
    168168        }
    169169
    170         $site_path = '';
    171         if ( is_multisite() && ! ( is_main_network() && is_main_site() ) ) {
    172                 $site_path = '/sites/' . get_current_blog_id();
    173         }
    174 
    175170        $font_dir = array(
    176                 'path'    => path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path,
    177                 'url'     => untrailingslashit( content_url( 'fonts' ) ) . $site_path,
     171                'path'    => untrailingslashit( $font_dir['basedir'] ) . '/fonts',
     172                'url'     => untrailingslashit( $font_dir['baseurl'] ) . '/fonts',
    178173                'subdir'  => '',
    179                 'basedir' => path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path,
    180                 'baseurl' => untrailingslashit( content_url( 'fonts' ) ) . $site_path,
     174                'basedir' => untrailingslashit( $font_dir['basedir'] ) . '/fonts',
     175                'baseurl' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts',
    181176                'error'   => false,
    182177        );
Note: See TracChangeset for help on using the changeset viewer.