mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8900fdfd76
commit
56fdee27eb
@ -754,11 +754,14 @@ function get_attached_file( $attachment_id, $unfiltered = false, $size = '' ) {
|
||||
* Filters the attached file based on the given ID.
|
||||
*
|
||||
* @since 2.1.0
|
||||
* @since 6.2.0 The `$size` parameter was added.
|
||||
*
|
||||
* @param string|false $file The file path to where the attached file should be, false otherwise.
|
||||
* @param int $attachment_id Attachment ID.
|
||||
* @param string|int[] $size Optional. Image size. Accepts any registered image size name, or an array
|
||||
* of width and height values in pixels (in that order). Default empty string.
|
||||
*/
|
||||
return apply_filters( 'get_attached_file', $file, $attachment_id );
|
||||
return apply_filters( 'get_attached_file', $file, $attachment_id, $size );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user