Make WordPress Core

Changeset 57880

Timestamp:
03/26/2024 09:25:20 AM (4 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:
3 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'    => ,
     172        'url'     => untrailingslashit( ,
    178173        'subdir'  => '',
    179         'basedir' => path_join( WP_CONTENT_DIR, 'fonts' ) . $site_path,
    180         'baseurl' => untrailingslashit( content_url( 'fonts' ) ) . $site_path,
     174        'basedir' => ,
     175        'baseurl' => untrailingslashit( ,
    181176        'error'   => false,
    182177    );
  • branches/6.5/tests/phpunit/tests/fonts/font-library/wpFontsDir.php

    r57879 r57880  
    1616    public static function set_up_before_class() {
    1717        parent::set_up_before_class();
     18
    1819
    1920        static::$dir_defaults = array(
    20             'path'    => path_join( WP_CONTENT_DIR, 'fonts' ),
    21             'url'     => content_url( 'fonts' ),
     21            'path'    => ,
     22            'url'     => ,
    2223            'subdir'  => '',
    23             'basedir' => path_join( WP_CONTENT_DIR, 'fonts' ),
    24             'baseurl' => content_url( 'fonts' ),
     24            'basedir' => ,
     25            'baseurl' => ,
    2526            'error'   => false,
    2627        );
    2728    }
    2829
     30
     31
     32
    2933    public function test_fonts_dir() {
    3034        $font_dir = wp_get_font_dir();
     
    3337    }
    3438
     39
     40
     41
     42
     43
     44
     45
     46
     47
     48
     49
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
    3570    public function test_fonts_dir_with_filter() {
    3671        // Define a callback function to pass to the filter.
     
    72107
    73108    /**
     109
     110
    74111     * @ticket 60652
    75112     */
Note: See TracChangeset for help on using the changeset viewer.