WPDev.one
Core Function
View Source on Trac ↗

is_attachment()

is_attachment( mixed $attachment = '' )

Determines whether the query is for an existing attachment page.

Parameters 1 required

Name / Type Description
mixed

(int | string | int[] | string[]) $attachment Optional. Attachment ID, title, slug, or array of such to check against. Default empty.

Required

Return Value

(bool)
Whether the query is for an existing attachment page.

Function Information

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