Retrieves path of attachment template in current or parent template.
Description
The hierarchy for this template looks like: <ol> <li>{mime_type}-{sub_type}.php</li> <li>{sub_type}.php</li> <li>{mime_type}.php</li> <li>attachment.php</li> </ol> An example of this is: <ol> <li>image-jpeg.php</li> <li>jpeg.php</li> <li>image.php</li> <li>attachment.php</li> </ol> The template hierarchy and template path are filterable via the '$type_template_hierarchy' and '$type_template' dynamic hooks, where $type is 'attachment'.
Signature, return type and hooks compared across 5 parsed releases.
4.3.0
The order of the mime type logic was reversed so the hierarchy is more logical.from the docblock
2.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 7.0.4 tag, from src/wp-includes/template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.