Changeset 38292 for trunk/src/wp-includes/media.php
- Timestamp:
- 08/20/2016 05:34:13 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r38086 r38292 2695 2695 * 2696 2696 * @since 2.5.0 2697 * @since 4.7.0 Introduced the `$output` parameter. 2697 2698 * 2698 2699 * @param int|array|object $attachment Attachment ID, data array, or data object. 2700 * @param string $output Output type. 'names' to return an array of taxonomy names, 2701 * or 'objects' to return an array of taxonomy objects. 2702 * Default is 'names'. 2699 2703 * @return array Empty array on failure. List of taxonomies on success. 2700 2704 */ 2701 function get_attachment_taxonomies( $attachment ) {2705 function get_attachment_taxonomies( $attachment, $output = 'names' ) { 2702 2706 if ( is_int( $attachment ) ) { 2703 2707 $attachment = get_post( $attachment ); … … 2724 2728 2725 2729 $taxonomies = array(); 2726 foreach ( $objects as $object ) 2727 if ( $taxes = get_object_taxonomies($object) ) 2728 $taxonomies = array_merge($taxonomies, $taxes); 2730 foreach ( $objects as $object ) { 2731 if ( $taxes = get_object_taxonomies( $object, $output ) ) { 2732 $taxonomies = array_merge( $taxonomies, $taxes ); 2733 } 2734 } 2729 2735 2730 2736 return array_unique($taxonomies);
Note: See TracChangeset
for help on using the changeset viewer.