From 4efd5d56238de102d4021ad133c1d68f192c052f Mon Sep 17 00:00:00 2001 From: joedolson Date: Fri, 3 Feb 2023 19:25:21 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@55217 git-svn-id: http://core.svn.wordpress.org/trunk@54750 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 5 ++++- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 59aab1216a..d9460d7838 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 78a07bcf80..94ee574b59 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55216'; +$wp_version = '6.2-alpha-55217'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.