wp_attachment_is( string $type, int|WP_Post $post = null )

Verifies an attachment is of a given type.

25 related functions found for: wp_attachment_is

Top ↑

Related terms found for this post

wp-parser-related-wordsattach, attachment, attachments, post-php, post-typ, post-type, wp-attachment, wp-includes
wp-parser-packagePost, WordPress

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • attach
  • attachment
  • attachments
  • Post
  • post-php
  • post-typ
  • post-type
  • wp-attachment
  • wp-includes
  • wp-includes/post.php
  • post

Top ↑

Description Description

Top ↑

Parameters Parameters


(string) (Required) Attachment type. Accepts 'image', 'audio', or 'video'.


(int|WP_Post) (Optional) Attachment ID or object. Default is global $post.

Default value: null

Top ↑

Return Return

(bool) True if one of the accepted types, false otherwise.

Top ↑

Source Source

File: wp-includes/post.php


Top ↑

Changelog Changelog

Version Description
4.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.