get_attachment_taxonomies [ WordPress Function ]
get_attachment_taxonomies ( $attachment )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: get_the_taxonomies, get_attachment_icon, get_attachment_icon_src, get_object_taxonomies, get_attachment_link
Retrieve taxonomies attached to the attachment.
Source
<?php
function get_attachment_taxonomies($attachment) {
if ( is_int( $attachment ) )
$attachment = get_post($attachment);
else if ( is_array($attachment) )
$attachment = (object) $attachment;
if ( ! is_object($attachment) )
return array();
$filename = basename($attachment->guid);
$objects = array('attachment');
if ( false !== strpos($filename, '.') )
$objects[] = 'attachment:' . substr($filename, strrpos($filename, '.') + 1);
if ( !empty($attachment->post_mime_type) ) {
$objects[] = 'attachment:' . $attachment->post_mime_type;
if ( false !== strpos($attachment->post_mime_type, '/') )
foreach ( explode('/', $attachment->post_mime_type) as $token )
if ( !empty($token) )
$objects[] = "attachment:$token";
}
$taxonomies = array();
foreach ( $objects as $object )
if ( $taxes = get_object_taxonomies($object) )
$taxonomies = array_merge($taxonomies, $taxes);
return array_unique($taxonomies);
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- get_attachment_taxonomies | A HitchHackers guide through ...
Feb 11, 2011 ... Source code. function get_attachment_taxonomies($attachment) { if ( is_int( $ attachment ) ) $attachment = get_post($attachment); else if ...
hitchhackerguide.com - Docs for page media.php
array get_attachment_taxonomies (int|array|object $attachment). int|array|object $attachment: Attachment ID, Attachment data array, or Attachment data object.
phpdoc.wordpress.org - get_attachment_taxonomies (WordPress Function) - WPSeek.com
WordPress lookup for get_attachment_taxonomies, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - get_attachment_taxonomies
Function and Method Cross Reference. get_attachment_taxonomies(). Defined at : /wp-includes/media.php -> line 945. Referenced 3 times: ...
phpxref.ftwr.co.uk