Make WordPress Core

Changeset 55217


Ignore:
Timestamp:
02/03/2023 07:23:40 PM (4 years ago)
Author:
joedolson
Message:

Media: Pass $size argument to get_attached_file filter.

Pass the new $size argument on get_attached_file() to get_attached_file filter. Follow up to [55199].

Props SergeyBiryukov, joedolson.
Fixes #51780.

File:
1 edited

Legend:

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

    r55215 r55217  
    755755         *
    756756         * @since 2.1.0
     757         * @since 6.2.0 The `$size` parameter was added.
    757758         *
    758759         * @param string|false $file          The file path to where the attached file should be, false otherwise.
    759760         * @param int          $attachment_id Attachment ID.
     761         * @param string|int[] $size          Optional. Image size. Accepts any registered image size name, or an array
     762         *                                    of width and height values in pixels (in that order). Default empty string.
    760763         */
    761         return apply_filters( 'get_attached_file', $file, $attachment_id );
     764        return apply_filters( 'get_attached_file', $file, $attachment_id, $size );
    762765}
    763766
Note: See TracChangeset for help on using the changeset viewer.