WPDev.one
Core Function
View Source on Trac ↗

get_attachment_taxonomies()

get_attachment_taxonomies( mixed $attachment, mixed $output = 'names' )

Retrieves taxonomies attached to given the attachment.

Parameters 2 required

Name / Type Description
(int

| array | object) $attachment Attachment ID, data array, or data object.

Required
string

$output Output type. 'names' to return an array of taxonomy names, or 'objects' to return an array of taxonomy objects. Default is 'names'.

Required

Return Value

((string[])
| WP_Taxonomy[]) List of taxonomies or taxonomy names. Empty array on failure.

Function Information

Since Version
2.5.0
Source File
wp-includes/media.php
Advertisement