Changeset 21948 for trunk/wp-includes/media.php
- Timestamp:
- 09/21/2012 10:52:54 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r21909 r21948 987 987 988 988 /** 989 * Return all of the taxonomy names that are registered for attachments. 990 * 991 * Handles mime-type-specific taxonomies such as attachment:image and attachment:video. 992 * 993 * @since 3.5.0 994 * @see get_attachment_taxonomies() 995 * @uses get_taxonomies() 996 * 997 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 998 * @return array The names of all taxonomy of $object_type. 999 */ 1000 function get_taxonomies_for_attachments( $output = 'names' ) { 1001 $taxonomies = array(); 1002 foreach ( get_taxonomies( array(), 'objects' ) as $taxonomy ) { 1003 foreach ( $taxonomy->object_type as $object_type ) { 1004 if ( 'attachment' == $object_type || 0 === strpos( $object_type, 'attachment:' ) ) { 1005 if ( 'names' == $output ) 1006 $taxonomies[] = $taxonomy->name; 1007 else 1008 $taxonomies[ $taxonomy->name ] = $taxonomy; 1009 break; 1010 } 1011 } 1012 } 1013 1014 return $taxonomies; 1015 } 1016 1017 /** 989 1018 * Check if the installed version of GD supports particular image type 990 1019 *
Note: See TracChangeset
for help on using the changeset viewer.