CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Thu, 09 Oct 2025 00:18:24 GMT
content-type: text/html;charset=utf-8
vary: Accept-Encoding
etag: W/"anonymous/Thu, 04 Mar 2010 19:39:54 GMT/False"
cache-control: must-revalidate
expires: Fri, 01 Jan 1999 00:00:00 GMT
alt-svc: h3=":443"; ma=86400
strict-transport-security: max-age=31536000
x-frame-options: SAMEORIGIN
content-encoding: gzip
get_taxonomies.diff on Ticket #12516 – Attachment
– WordPress Trac
Ticket #12516: get_taxonomies.diff
File get_taxonomies.diff, 1.5 KB (added by ptahdunbar, 16 years ago) |
---|
-
wp-includes/taxonomy.php
56 56 add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority 57 57 58 58 /** 59 * Get a list of all registered taxonomy objects. 60 * 61 * @package WordPress 62 * @subpackage Taxonomy 63 * @since 2.9.0 64 * @uses $wp_taxonomies 65 * @see register_taxonomy 66 * 67 * @param array|string $args An array of key => value arguments to match against the taxonomies. 68 * Only taxonomies having attributes that match all arguments are returned. 69 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 70 * @return array A list of taxonomy names or objects 71 */ 72 function get_taxonomies( $args = array(), $output = 'names' ) { 73 global $wp_taxonomies; 74 75 $do_names = false; 76 if ( 'names' == $output ) 77 $do_names = true; 78 79 $taxonomies = array(); 80 foreach ( (array) $wp_taxonomies as $taxonomy ) { 81 if ( empty($args) ) { 82 if ( $do_names ) 83 $taxonomies[] = $taxonomy->name; 84 else 85 $taxonomies[] = $taxonomy; 86 } elseif ( array_intersect_assoc((array) $taxonomy, $args) ) { 87 if ( $do_names ) 88 $taxonomies[] = $taxonomy->name; 89 else 90 $taxonomies[] = $taxonomy; 91 } 92 } 93 94 return $taxonomies; 95 } 96 97 /** 59 98 * Return all of the taxonomy names that are of $object_type. 60 99 * 61 100 * It appears that this function can be used to find all of the names inside of