Make WordPress Core


Ignore:
Timestamp:
05/10/2024 06:57:53 PM (9 months ago)
Author:
swissspidy
Message:

REST API: Ensure attachments are uploaded to the post's year/month folder.

If organizing uploads into month- and year-based folders, uploading an attachment to an existing post should store the file in wp-content/uploads/<year>/<month> based on the post's publish date. This is in line with the behavior in classic editor / the media modal.

Props swissspidy, adamsilverstein, timothyblynjacobs, skithund, sergeybiryukov, patricia70.
Fixes #61189.

File:
1 edited

Legend:

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

    r57984 r58130  
    10901090 *                               to override default variables. Default false.
    10911091 *                               See _wp_handle_upload() for accepted values.
    1092  * @param string      $time      Optional. Time formatted in 'yyyy/mm'. Default null.
     1092 * @param string|null $time      Optional. Time formatted in 'yyyy/mm'. Default null.
    10931093 * @return array See _wp_handle_upload() for return value.
    10941094 */
     
    11211121 *                               to override default variables. Default false.
    11221122 *                               See _wp_handle_upload() for accepted values.
    1123  * @param string      $time      Optional. Time formatted in 'yyyy/mm'. Default null.
     1123 * @param string|null $time      Optional. Time formatted in 'yyyy/mm'. Default null.
    11241124 * @return array See _wp_handle_upload() for return value.
    11251125 */
Note: See TracChangeset for help on using the changeset viewer.