Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #61297


Ignore:
Timestamp:
05/27/2024 12:27:24 AM (6 months ago)
Author:
peterwilsoncc
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #61297 – Description

    initial v1  
    88* error (only used during directory creation)
    99
    10 When uploading fonts, the sub-directory property is ignored and prevents the use of sub-directories by developers.
    11 
    12 This prevents developers from being able to organize the font files by font-family or the active theme at time of upload.
     10When uploading fonts, the sub-directory is not stored in the post meta and prevents the deletion of files when the font-face post objects are deleted.
    1311
    1412{{{#!php
     
    2018         * request or the currently active theme and use either of those values
    2119         * to generate a unique sub-directory.
    22          * 
    23          * The POC is simply to allow for eaiser testing by setting a new 
     20         *
     21         * The POC is simply to allow for eaiser testing by setting a new
    2422         * sub-directory every few minutes.
    2523         */
    26         $font_dir['subdir'] = floor( time() / 300 );
     24        $subdir = '/' . (string) floor( time() / 300 );
     25        $font_dir['subdir'] = $subdir;
     26        $font_dir['path'] .= $subdir;
     27        $font_dir['url'] .= $subdir;
    2728        return $font_dir;
    2829} );
     
    3132The following will need to be updated to account for the sub-directory:
    3233
    33 * upload destination
    3434* post meta data containing the file reference
    3535* deletion of files in `_wp_before_delete_font_face()`
     36
     37To reproduce:
     38
     39* Upload a font/sideload from Google
     40* Observe the font file is stored in a sub-directory
     41* Observe the font file's sub-directory is not stored in the post meta
     42* Wait five minutes (using sample plugin above)
     43* Delete the font via the font library
     44* Observe the file is not deleted