W3cubDocs

/WordPress

apply_filters( ‘get_attached_file’, string|false $file, int $attachment_id )

Filters the attached file based on the given ID.

Parameters

$filestring|false
The file path to where the attached file should be, false otherwise.
$attachment_idint
Attachment ID.

Source

return apply_filters( 'get_attached_file', $file, $attachment_id );

Changelog

Version Description
2.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_attached_file