diff --git src/wp-includes/taxonomy.php src/wp-includes/taxonomy.php
index 42b236a..d6f0150 100644
|
|
|
|
| 2 | 2 | /** |
| 3 | 3 | * Taxonomy API |
| 4 | 4 | * |
| | 5 | * @since 2.3.0 |
| | 6 | * |
| 5 | 7 | * @package WordPress |
| 6 | 8 | * @subpackage Taxonomy |
| 7 | | * @since 2.3.0 |
| 8 | 9 | */ |
| 9 | 10 | |
| 10 | 11 | // |
| … |
… |
|
| 15 | 16 | * Creates the initial taxonomies. |
| 16 | 17 | * |
| 17 | 18 | * This function fires twice: in wp-settings.php before plugins are loaded (for |
| 18 | | * backwards compatibility reasons), and again on the 'init' action. We must avoid |
| 19 | | * registering rewrite rules before the 'init' action. |
| | 19 | * backwards compatibility reasons), and again on the `init` action. We must avoid |
| | 20 | * registering rewrite rules before the `init` action. |
| | 21 | * |
| | 22 | * @since 2.8.0 |
| | 23 | * |
| | 24 | * @global object $wp_rewrite The WordPress rewrite class. |
| 20 | 25 | */ |
| 21 | 26 | function create_initial_taxonomies() { |
| 22 | 27 | global $wp_rewrite; |
| … |
… |
function create_initial_taxonomies() { |
| 129 | 134 | } |
| 130 | 135 | |
| 131 | 136 | /** |
| 132 | | * Get a list of registered taxonomy objects. |
| | 137 | * Get a list of registered taxonomy names or objects. |
| 133 | 138 | * |
| 134 | 139 | * @since 3.0.0 |
| 135 | | * @uses $wp_taxonomies |
| | 140 | * |
| | 141 | * @global array $wp_taxonomies The registered taxonomies. |
| 136 | 142 | * |
| 137 | 143 | * @param array $args An array of key => value arguments to match against the taxonomy objects. |
| 138 | 144 | * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. |
| … |
… |
function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) |
| 159 | 165 | * |
| 160 | 166 | * @since 2.3.0 |
| 161 | 167 | * |
| 162 | | * @uses $wp_taxonomies |
| | 168 | * @global array $wp_taxonomies The registered taxonomies. |
| 163 | 169 | * |
| 164 | 170 | * @param array|string|object $object Name of the type of taxonomy object, or an object (row from posts) |
| 165 | 171 | * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. |
| … |
… |
function get_object_taxonomies($object, $output = 'names') { |
| 197 | 203 | * |
| 198 | 204 | * @since 2.3.0 |
| 199 | 205 | * |
| 200 | | * @uses $wp_taxonomies |
| | 206 | * @global array $wp_taxonomies The registered taxonomies. |
| 201 | 207 | * |
| 202 | 208 | * @param string $taxonomy Name of taxonomy object to return |
| 203 | 209 | * @return object|bool The Taxonomy Object or false if $taxonomy doesn't exist |
| … |
… |
function get_taxonomy( $taxonomy ) { |
| 218 | 224 | * |
| 219 | 225 | * @since 3.0.0 |
| 220 | 226 | * |
| 221 | | * @uses $wp_taxonomies |
| | 227 | * @global array $wp_taxonomies The registered taxonomies. |
| 222 | 228 | * |
| 223 | 229 | * @param string $taxonomy Name of taxonomy object |
| 224 | 230 | * @return bool Whether the taxonomy exists. |
| … |
… |
function is_taxonomy_hierarchical($taxonomy) { |
| 311 | 317 | * |
| 312 | 318 | * @since 2.3.0 |
| 313 | 319 | * @since 4.2.0 Introduced 'show_in_quick_edit' parameter. |
| 314 | | * @uses $wp_taxonomies Inserts new taxonomy object into the list |
| 315 | | * @uses $wp Adds query vars |
| | 320 | * |
| | 321 | * @global array $wp_taxonomies The registered taxonomies. |
| | 322 | * @global object $wp The WordPress environment class. |
| 316 | 323 | * |
| 317 | 324 | * @param string $taxonomy Taxonomy key, must not exceed 32 characters. |
| 318 | 325 | * @param array|string $object_type Name of the object type for the taxonomy object. |
| … |
… |
function register_taxonomy( $taxonomy, $object_type, $args = array() ) { |
| 463 | 470 | * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories). |
| 464 | 471 | * |
| 465 | 472 | * @since 3.0.0 |
| | 473 | * |
| 466 | 474 | * @param object $tax Taxonomy object |
| 467 | 475 | * @return object object with all the labels as member variables |
| 468 | 476 | */ |
| … |
… |
function get_taxonomy_labels( $tax ) { |
| 503 | 511 | * Add an already registered taxonomy to an object type. |
| 504 | 512 | * |
| 505 | 513 | * @since 3.0.0 |
| 506 | | * @uses $wp_taxonomies Modifies taxonomy object |
| | 514 | * |
| | 515 | * @global array $wp_taxonomies The registered taxonomies. |
| 507 | 516 | * |
| 508 | 517 | * @param string $taxonomy Name of taxonomy object |
| 509 | 518 | * @param string $object_type Name of the object type |
| … |
… |
function register_taxonomy_for_object_type( $taxonomy, $object_type) { |
| 529 | 538 | * |
| 530 | 539 | * @since 3.7.0 |
| 531 | 540 | * |
| | 541 | * @global array $wp_taxonomies The registered taxonomies. |
| | 542 | * |
| 532 | 543 | * @param string $taxonomy Name of taxonomy object. |
| 533 | 544 | * @param string $object_type Name of the object type. |
| 534 | 545 | * @return bool True if successful, false if not. |
| … |
… |
class WP_Tax_Query { |
| 1000 | 1011 | * @since 4.1.0 |
| 1001 | 1012 | * @access public |
| 1002 | 1013 | * |
| | 1014 | * @global object $wpdb The WordPress database abstraction object. |
| | 1015 | * |
| 1003 | 1016 | * @param array $clause Query clause, passed by reference |
| 1004 | 1017 | * @param array $parent_query Parent query array. |
| 1005 | 1018 | * @return array { |
| … |
… |
class WP_Tax_Query { |
| 1208 | 1221 | * |
| 1209 | 1222 | * @since 3.2.0 |
| 1210 | 1223 | * |
| | 1224 | * @global object $wpdb The WordPress database abstraction object. |
| | 1225 | * |
| 1211 | 1226 | * @param array &$query The single query. |
| 1212 | 1227 | * @param string $resulting_field The resulting field. Accepts 'slug', 'name', 'term_taxonomy_id', |
| 1213 | 1228 | * or 'term_id'. Default: 'term_id'. |
| … |
… |
function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw |
| 1460 | 1475 | * |
| 1461 | 1476 | * @since 2.3.0 |
| 1462 | 1477 | * |
| 1463 | | * @global wpdb $wpdb WordPress database abstraction object. |
| 1464 | | * |
| 1465 | 1478 | * @param string $term_id ID of Term to get children |
| 1466 | 1479 | * @param string $taxonomy Taxonomy Name |
| 1467 | 1480 | * @return array|WP_Error List of Term IDs. WP_Error returned if $taxonomy does not exist |
| … |
… |
function wp_insert_term( $term, $taxonomy, $args = array() ) { |
| 3051 | 3064 | * |
| 3052 | 3065 | * @since 2.3.0 |
| 3053 | 3066 | * |
| | 3067 | * @global object $wpdb The WordPress database abstraction object. |
| | 3068 | * |
| 3054 | 3069 | * @param int $object_id The object to relate to. |
| 3055 | 3070 | * @param array|int|string $terms A single term slug, single term id, or array of either term slugs or ids. |
| 3056 | 3071 | * Will replace all existing related terms in this taxonomy. |