2020-05-01 / 5441阅 / 悠然
Retrieve attached file path based>
By default the path will go through the ‘get_attached_file’ filter, but passing a true to the $unfiltered argument of get_attached_file() will return the file path unfiltered.
The function works by getting the single post meta name, named ‘_wp_attached_file’ and returning it. This is a convenience function to prevent looking up the meta name and provide a mechanism for sending the attached filename through a filter.
(int)
(Required)
Attachment ID.
(bool)
(Optional)
Whether to apply filters.
Default value: false
(string|false) The file path to where the attached file should be, false otherwise.