Make WordPress Core


Ignore:
Timestamp:
03/26/2024 09:25:20 AM (14 months ago)
Author:
swissspidy
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.

Reviewed by davidbaumwald.
Merges [57878] to the 6.5 branch.

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.

Location:
branches/6.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.5

  • branches/6.5/src/wp-includes/fonts.php

    r57879 r57880  
    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.