WPDev.one
Core Function
View Source on Trac ↗

get_attached_file()

get_attached_file( mixed $attachment_id, mixed $unfiltered = false )

Retrieves attached file path based on attachment ID.

Parameters 2 required

Name / Type Description
$attachment_id
int

Attachment ID.

Required
bool

$unfiltered Optional. Whether to skip the {@see 'get_attached_file'} filter. Default false.

Required

Return Value

((string)
| false) The file path to where the attached file should be, false otherwise.

Function Information

Since Version
2.0.0
Source File
wp-includes/post.php
Advertisement