Changeset 6282
- Timestamp:
- 10/21/2007 05:18:24 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r6271 r6282 11 11 12 12 /** 13 * @global array $wp_taxonomies Default Taxonomy Objects 13 * Default Taxonomy Objects 14 * @since 2.3 15 * @global array $wp_taxonomies 14 16 */ 15 17 $wp_taxonomies = array(); … … 24 26 * $wp_taxonomies global variable. 25 27 * 26 * @example 27 * <?php $taxonomies = get_object_taxonomies('post'); ?> 28 * Should result in <pre>Array( 29 * 'category', 30 * 'post_tag' 31 * )</pre> 32 * 33 * @package WordPress 34 * @subpackage Taxonomy 28 * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> 29 * Should result in <code>Array('category', 'post_tag')</code> 30 * 31 * @package WordPress 32 * @subpackage Taxonomy 33 * @since 2.3 35 34 * 36 * @global array $wp_taxonomies 35 * @uses $wp_taxonomies 36 * 37 37 * @param string $object_type Name of the type of taxonomy object 38 * @return array The names of all within the object_type. 39 * 40 * @internal 41 * This is all conjecture and might be partially or completely inaccurate. 38 * @return array The names of all taxonomy of $object_type. 42 39 */ 43 40 function get_object_taxonomies($object_type) { … … 54 51 55 52 /** 56 * get_taxonomy() - Returns the "taxonomy"object of $taxonomy.53 * get_taxonomy() - Returns the taxonomy object of $taxonomy. 57 54 * 58 55 * The get_taxonomy function will first check that the parameter string given … … 61 58 * @package WordPress 62 59 * @subpackage Taxonomy 63 * 64 * @global array $wp_taxonomies 60 * @since 2.3 61 * 62 * @uses $wp_taxonomies 63 * @uses is_taxonomy() Checks whether taxonomy exists 64 * 65 65 * @param string $taxonomy Name of taxonomy object to return 66 * @return object|bool The Taxonomy Object or false if taxonomy doesn't exist 67 * 68 * @internal 69 * This is all conjecture and might be partially or completely inaccurate. 66 * @return object|bool The Taxonomy Object or false if $taxonomy doesn't exist 70 67 */ 71 68 function get_taxonomy( $taxonomy ) { … … 83 80 * @package WordPress 84 81 * @subpackage Taxonomy 82 * @since 2.3 85 83 * 86 * @global array $wp_taxonomies 84 * @uses $wp_taxonomies 85 * 87 86 * @param string $taxonomy Name of taxonomy object 88 87 * @return bool Whether the taxonomy exists or not. 89 *90 * @internal91 * This is all conjecture and might be partially or completely inaccurate.92 88 */ 93 89 function is_taxonomy( $taxonomy ) { … … 107 103 * @package WordPress 108 104 * @subpackage Taxonomy 109 * 110 * @global array $wp_taxonomies 105 * @since 2.3 106 * 107 * @uses is_taxonomy() Checks whether taxonomy exists 108 * @uses get_taxonomy() Used to get the taxonomy object 109 * 111 110 * @param string $taxonomy Name of taxonomy object 112 111 * @return bool Whether the taxonomy is hierarchical 113 *114 * @internal115 * This is all conjecture and might be partially or completely inaccurate.116 112 */ 117 113 function is_taxonomy_hierarchical($taxonomy) { … … 134 130 * keys: hierarchical and update_count_callback. 135 131 * 136 * hierarachical has some defined purpose at other parts of the API and is a boolean value. 137 * 138 * update_count_callback works much like a hook, in that it will be called (or something from 139 * somewhere). 140 * 141 * @package WordPress 142 * @subpackage Taxonomy 132 * Nothing is returned, so expect error maybe or use is_taxonomy() to check whether taxonomy exists. 133 * 134 * Optional $args contents: 135 * hierarachical - has some defined purpose at other parts of the API and is a boolean value. 136 * update_count_callback - works much like a hook, in that it will be called when the count is updated. 137 * 138 * @package WordPress 139 * @subpackage Taxonomy 140 * @since 2.3 141 * @uses $wp_taxonomies Inserts new taxonomy object into the list 143 142 * 144 * @global array $wp_taxonomies145 143 * @param string $taxonomy Name of taxonomy object 146 144 * @param string $object_type Name of the object type for the taxonomy object. 147 145 * @param array|string $args See above description for the two keys values. 148 * @return null Nothing is returned, so expect error maybe or use is_taxonomy() to check.149 *150 * @internal151 * This is all conjecture and might be partially or completely inaccurate.152 146 */ 153 147 function register_taxonomy( $taxonomy, $object_type, $args = array() ) { … … 182 176 * @package WordPress 183 177 * @subpackage Taxonomy 184 * @category Term 185 * 186 * @global object $wpdb Database Query 178 * @since 2.3 179 * 180 * @uses $wpdb 181 * @uses wp_parse_args() Creates an array from string $args. 182 * 187 183 * @param string|array $terms String of term or array of string values of terms that will be used 188 184 * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names 189 185 * @param array|string $args Change the order of the object_ids, either ASC or DESC 190 * @return object WP_Error - A PHP 4 compatible Exception class prototype 191 * @return array Empty array if there are no $object_ids 192 * @return array Array of $object_ids 193 * 194 * @internal 195 * This is all conjecture and might be partially or completely inaccurate. 186 * @return WP_Error|array If the taxonomy does not exist, then WP_Error will be returned. On success 187 * the array can be empty meaning that there are no $object_ids found or it will return the $object_ids found. 196 188 */ 197 189 function get_objects_in_term( $terms, $taxonomies, $args = array() ) { … … 233 225 * The usage of the get_term function is to apply filters to a term object. 234 226 * It is possible to get a term object from the database before applying the 235 * filters. 227 * filters. 236 228 * 237 229 * $term ID must be part of $taxonomy, to get from the database. Failure, might be … … 239 231 * get_row method. 240 232 * 241 * There are two hooks, one is specifically for each term, named 'get_term', and the second is 242 * for the taxonomy name. Both hooks gets the term object, and the taxonomy name as parameters. 243 * Both hooks are expected to return a Term object. 244 * 245 * @package WordPress 246 * @subpackage Taxonomy 247 * @category Term 248 * 249 * @global object $wpdb Database Query 233 * There are two hooks, one is specifically for each term, named 'get_term', and the second is 234 * for the taxonomy name, 'term_$taxonomy'. Both hooks gets the term object, and the taxonomy 235 * name as parameters. Both hooks are expected to return a Term object. 236 * 237 * 'get_term' hook - Takes two parameters the term Object and the taxonomy name. Must return 238 * term object. Used in @see get_term() as a catch-all filter for every $term. 239 * 240 * 'get_$taxonomy' hook - Takes two parameters the term Object and the taxonomy name. Must return 241 * term object. $taxonomy will be the taxonomy name, so for example, if 'category', it would be 242 * 'get_category' as the filter name. Useful for custom taxonomies or plugging into default taxonomies. 243 * 244 * @package WordPress 245 * @subpackage Taxonomy 246 * @since 2.3 247 * 248 * @uses $wpdb 249 * 250 250 * @param int|object $term If integer, will get from database. If object will apply filters and return $term. 251 251 * @param string $taxonomy Taxonomy name that $term is part of. 252 252 * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N 253 * @param string $filter 254 * @return mixed Term Row from database 255 * 256 * @internal 257 * This is all conjecture and might be partially or completely inaccurate. 258 * Uses custom hook phpdoc documentation that isn't compatible with phpDoc. Useful for a custom 259 * solution if used in an uniform fashion throughout the code base. 253 * @param string $filter {@internal Missing Description}} 254 * @return mixed|null|WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not 255 * exist then WP_Error will be returned. 260 256 */ 261 257 function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { … … 279 275 } 280 276 281 /**282 * @internal283 *284 * Takes two parameters the term Object and the taxonomy name. Must return term object.285 * Used in @see get_term() as a catch-all filter for every $term.286 *287 * @hook-name get_term288 * @hook-return object289 * @hook-param object $_term The current term object290 * @hook-param string $taxonomy What taxonomy the term is in.291 */292 277 $_term = apply_filters('get_term', $_term, $taxonomy); 293 294 /**295 * @internal296 *297 * Takes two parameters the term Object and the taxonomy name. Must return term object.298 * $taxonomy will be the taxonomy name, so for example, if 'category', it would be 'get_category'299 * as the filter name.300 *301 * Useful for custom taxonomies or plugging into default taxonomies.302 *303 * @hook-name get_$taxonomy304 * @hook-return object305 * @hook-param object $_term The current term object306 * @hook-param string $taxonomy What taxonomy the term is in.307 */308 278 $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); 309 279 $_term = sanitize_term($_term, $taxonomy, $filter); … … 330 300 * If $value does not exist, the return value will be false. If $taxonomy exists and $field 331 301 * and $value combinations exist, the Term will be returned. 332 * 333 * 334 * @ package WordPress335 * @s ubpackage Taxonomy336 * @category Term337 * 338 * @global object $wpdb Database Query302 * 303 * @package WordPress 304 * @subpackage Taxonomy 305 * @since 2.3 306 * 307 * @uses $wpdb 308 * 339 309 * @param string $field Either 'slug', 'name', or 'id' 340 310 * @param string|int $value Search for this term value 341 311 * @param string $taxonomy Taxonomy Name 342 312 * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N 343 * @param string $filter 344 * @return mixed Term Row from database 345 * 346 * @internal 347 * This is all conjecture and might be partially or completely inaccurate. 313 * @param string $filter {@internal Missing Description}} 314 * @return mixed Term Row from database. Will return false if $taxonomy does not exist or $term was not found. 348 315 */ 349 316 function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') { … … 389 356 * 390 357 * This recursive function will merge all of the children of $term into 391 * the same array. 392 * 393 * Only useful for taxonomies which are hierarchical.358 * the same array. Only useful for taxonomies which are hierarchical. 359 * 360 * Will return an empty array if $term does not exist in $taxonomy. 394 361 * 395 362 * @package WordPress 396 363 * @subpackage Taxonomy 397 * @category Term 398 * 399 * @global object $wpdb Database Query 364 * @since 2.3 365 * 366 * @uses $wpdb 367 * @uses _get_term_hierarchy() 368 * @uses get_term_children() Used to get the children of both $taxonomy and the parent $term 369 * 400 370 * @param string $term Name of Term to get children 401 371 * @param string $taxonomy Taxonomy Name 402 * @return array List of Term Objects 403 * 404 * @internal 405 * This is all conjecture and might be partially or completely inaccurate. 372 * @return array|WP_Error List of Term Objects. WP_Error returned if $taxonomy does not exist 406 373 */ 407 374 function get_term_children( $term, $taxonomy ) { … … 433 400 * @package WordPress 434 401 * @subpackage Taxonomy 435 * @category Term 402 * @since 2.3 403 * 404 * @uses sanitize_term_field() Passes the return value in sanitize_term_field on success. 436 405 * 437 406 * @param string $field Term field to fetch 438 407 * @param int $term Term ID 439 408 * @param string $taxonomy Taxonomy Name 440 * @param string $context ?? 441 * @return mixed @see sanitize_term_field() 442 * 443 * @internal 444 * This is all conjecture and might be partially or completely inaccurate. 409 * @param string $context {@internal Missing Description}} 410 * @return mixed Will return an empty string if $term is not an object or if $field is not set in $term. 445 411 */ 446 412 function get_term_field( $field, $term, $taxonomy, $context = 'display' ) { … … 467 433 * @package WordPress 468 434 * @subpackage Taxonomy 469 * @category Term 435 * @since 2.3 436 * 437 * @uses sanitize_term() Passes the return value on success 470 438 * 471 439 * @param int|object $id Term ID or Object 472 440 * @param string $taxonomy Taxonomy Name 473 * @return mixed @see sanitize_term() 474 * 475 * @internal 476 * This is all conjecture and might be partially or completely inaccurate. 441 * @return mixed|null|WP_Error Will return empty string if $term is not an object. 477 442 */ 478 443 function get_term_to_edit( $id, $taxonomy ) { … … 489 454 490 455 /** 491 * get_terms() - 492 * 493 * 494 * 495 * @package WordPress 496 * @subpackage Taxonomy 497 * @category Term 456 * get_terms() - Retrieve the terms in taxonomy or list of taxonomies. 457 * 458 * You can fully inject any customizations to the query before it is sent, as well as control 459 * the output with a filter. 460 * 461 * The 'get_terms' filter will be called when the cache has the term and will pass the found 462 * term along with the array of $taxonomies and array of $args. This filter is also called 463 * before the array of terms is passed and will pass the array of terms, along with the $taxonomies 464 * and $args. 465 * 466 * The 'list_terms_exclusions' filter passes the compiled exclusions along with the $args. 467 * 468 * The list that $args can contain, which will overwrite the defaults. 469 * orderby - Default is 'name'. Can be name, count, or nothing (will use term_id). 470 * order - Default is ASC. Can use DESC. 471 * hide_empty - Default is true. Will not return empty $terms. 472 * fields - Default is all. 473 * slug - Any terms that has this value. Default is empty string. 474 * hierarchical - Whether to return hierarchical taxonomy. Default is true. 475 * name__like - Default is empty string. 476 * 477 * The argument 'pad_counts' will count all of the children along with the $terms. 478 * 479 * The 'get' argument allows for overwriting 'hide_empty' and 'child_of', which can be done by 480 * setting the value to 'all', instead of its default empty string value. 481 * 482 * The 'child_of' argument will be used if you use multiple taxonomy or the first $taxonomy 483 * isn't hierarchical or 'parent' isn't used. The default is 0, which will be translated to 484 * a false value. If 'child_of' is set, then 'child_of' value will be tested against 485 * $taxonomy to see if 'child_of' is contained within. Will return an empty array if test 486 * fails. 487 * 488 * If 'parent' is set, then it will be used to test against the first taxonomy. Much like 489 * 'child_of'. Will return an empty array if the test fails. 490 * 491 * @package WordPress 492 * @subpackage Taxonomy 493 * @since 2.3 494 * 495 * @uses $wpdb 496 * @uses wp_parse_args() Merges the defaults with those defined by $args and allows for strings. 498 497 * 499 498 * @param string|array Taxonomy name or list of Taxonomy names 500 * @param string|array $args ?? 501 * @return array List of Term Objects and their children. 502 * 503 * @internal 504 * This is all conjecture and might be partially or completely inaccurate. 499 * @param string|array $args The values of what to search for when returning terms 500 * @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist. 505 501 */ 506 502 function &get_terms($taxonomies, $args = '') { … … 684 680 * @package WordPress 685 681 * @subpackage Taxonomy 686 * @category Term 687 * 688 * @global $wpdb Database Object 682 * @since 2.3 683 * 684 * @uses $wpdb 685 * 689 686 * @param int|string $term The term to check 690 687 * @param string $taxonomy The taxonomy name to use … … 721 718 * @package WordPress 722 719 * @subpackage Taxonomy 723 * @category Term 720 * @since 2.3 721 * 722 * @uses sanitize_term_field Used to sanitize all fields in a term 724 723 * 725 724 * @param array|object $term The term to check 726 725 * @param string $taxonomy The taxonomy name to use 727 * @param string $context Default is display726 * @param string $context Default is 'display'. 728 727 * @return array|object Term with all fields sanitized 729 728 */ … … 746 745 747 746 /** 748 * sanitize_term_field() - 749 * 750 * 751 * 752 * @package WordPress 753 * @subpackage Taxonomy 754 * @category Term 755 * 756 * @global object $wpdb Database Object 747 * sanitize_term_field() - {@internal Missing Short Description}} 748 * 749 * {@internal Missing Long Description}} 750 * 751 * @package WordPress 752 * @subpackage Taxonomy 753 * @since 2.3 754 * 755 * @uses $wpdb 756 * 757 757 * @param string $field Term field to sanitize 758 758 * @param string $value Search for this term value … … 801 801 * wp_count_terms() - Count how many terms are in Taxonomy 802 802 * 803 * Default $args is 'ignore_empty' which can be @example 'ignore_empty=true' or 804 * @example array('ignore_empty' => true); See @see wp_parse_args() for more 805 * information on parsing $args. 806 * 807 * @package WordPress 808 * @subpackage Taxonomy 809 * @category Term 810 * 811 * @global object $wpdb Database Object 803 * Default $args is 'ignore_empty' which can be <code>'ignore_empty=true'</code> or 804 * <code>array('ignore_empty' => true);</code>. 805 * 806 * @package WordPress 807 * @subpackage Taxonomy 808 * @since 2.3 809 * 810 * @uses $wpdb 811 * @uses wp_parse_args() Turns strings into arrays and merges defaults into an array. 812 * 812 813 * @param string $taxonomy Taxonomy name 813 814 * @param array|string $args Overwrite defaults … … 830 831 831 832 /** 832 * wp_delete_object_term_relationships() - 833 * 834 * 835 * 836 * @package WordPress 837 * @subpackage Taxonomy 838 * @ category Term839 * 840 * @global object $wpdb Database Object841 * @param int $object_id ??833 * wp_delete_object_term_relationships() - {@internal Missing Short Description}} 834 * 835 * {@internal Missing Long Description}} 836 * 837 * @package WordPress 838 * @subpackage Taxonomy 839 * @since 2.3 840 * @uses $wpdb 841 * 842 * @param int $object_id The term Object Id that refers to the term 842 843 * @param string|array $taxonomy List of Taxonomy Names or single Taxonomy name. 843 844 */ … … 861 862 * wp_delete_term() - Removes a term from the database. 862 863 * 863 * 864 * 865 * @package WordPress 866 * @subpackage Taxonomy 867 * @ category Term868 * 869 * @global object $wpdb Database Object864 * {@internal Missing Long Description}} 865 * 866 * @package WordPress 867 * @subpackage Taxonomy 868 * @since 2.3 869 * @uses $wpdb 870 * 870 871 * @param int $term Term ID 871 872 * @param string $taxonomy Taxonomy Name 872 873 * @param array|string $args Change Default 873 * @ parambool Returns false if not term; true if completes delete action.874 * @return bool Returns false if not term; true if completes delete action. 874 875 */ 875 876 function wp_delete_term( $term, $taxonomy, $args = array() ) { … … 931 932 * wp_get_object_terms() - Returns the terms associated with the given object(s), in the supplied taxonomies. 932 933 * 933 * 934 * 935 * @package WordPress 936 * @subpackage Taxonomy 937 * @ category Term938 * 939 * @global $wpdb Database Object940 * @param int|array $object_id The id of the object(s)) to retrieve for.934 * {@internal Missing Long Description}} 935 * 936 * @package WordPress 937 * @subpackage Taxonomy 938 * @since 2.3 939 * @uses $wpdb 940 * 941 * @param int|array $object_id The id of the object(s)) to retrieve. 941 942 * @param string|array $taxonomies The taxonomies to retrieve terms from. 942 943 * @param array|string $args Change what is returned 943 * @return array The requested term data.944 * @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist. 944 945 */ 945 946 function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { … … 999 1000 * wp_insert_term() - Adds a new term to the database. Optionally marks it as an alias of an existing term. 1000 1001 * 1001 * 1002 * 1003 * @package WordPress 1004 * @subpackage Taxonomy 1005 * @ category Term1006 * 1007 * @global $wpdb Database Object1002 * {@internal Missing Long Description}} 1003 * 1004 * @package WordPress 1005 * @subpackage Taxonomy 1006 * @since 2.3 1007 * @uses $wpdb 1008 * 1008 1009 * @param int|string $term The term to add or update. 1009 1010 * @param string $taxonomy The taxonomy to which to add the term 1010 1011 * @param array|string $args Change the values of the inserted term 1011 * @return array The Term ID and Term Taxonomy ID1012 * @return array|WP_Error The Term ID and Term Taxonomy ID 1012 1013 */ 1013 1014 function wp_insert_term( $term, $taxonomy, $args = array() ) { … … 1084 1085 1085 1086 /** 1086 * wp_set_object_terms() - 1087 * wp_set_object_terms() - {@internal Missing Short Description}} 1087 1088 * 1088 1089 * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy … … 1091 1092 * @package WordPress 1092 1093 * @subpackage Taxonomy 1093 * @ category Term1094 * 1095 * @global $wpdb Database Object1094 * @since 2.3 1095 * @uses $wpdb 1096 * 1096 1097 * @param int $object_id The object to relate to. 1097 1098 * @param array|int|string $term The slug or id of the term. 1098 1099 * @param array|string $taxonomy The context in which to relate the term to the object. 1099 1100 * @param bool $append If false will delete difference of terms. 1100 * @return array Affected Term IDs1101 * @return array|WP_Error Affected Term IDs 1101 1102 */ 1102 1103 function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { … … 1146 1147 1147 1148 /** 1148 * wp_unique_term_slug() - Will make @see $slug unique, if it isn't already1149 * wp_unique_term_slug() - Will make slug unique, if it isn't already 1149 1150 * 1150 * The @see$slug has to be unique global to every taxonomy, meaning that one taxonomy1151 * The $slug has to be unique global to every taxonomy, meaning that one taxonomy 1151 1152 * term can't have a matching slug with another taxonomy term. Each slug has to be 1152 1153 * globally unique for every taxonomy. 1153 1154 * 1154 1155 * The way this works is that if the taxonomy that the term belongs to is heirarchical 1155 * and has a parent, it will append that parent to the @see$slug.1156 * and has a parent, it will append that parent to the $slug. 1156 1157 * 1157 1158 * If that still doesn't return an unique slug, then it try to append a number until 1158 1159 * it finds a number that is truely unique. 1159 1160 * 1160 * The only purpose for @see$term is for appending a parent, if one exists.1161 * 1162 * @package WordPress 1163 * @subpackage Taxonomy 1164 * @ category Term1165 * 1166 * @global $wpdb Database Object1161 * The only purpose for $term is for appending a parent, if one exists. 1162 * 1163 * @package WordPress 1164 * @subpackage Taxonomy 1165 * @since 2.3 1166 * @uses $wpdb 1167 * 1167 1168 * @param string $slug The string that will be tried for a unique slug 1168 1169 * @param object $term The term object that the $slug will belong too … … 1202 1203 1203 1204 /** 1204 * wp_update_term() - 1205 * 1206 * 1207 * 1208 * @package WordPress 1209 * @subpackage Taxonomy 1210 * @ category Term1211 * 1212 * @global $wpdb Database Object1205 * wp_update_term() - {@internal Missing Short Description}} 1206 * 1207 * {@internal Missing Long Description}} 1208 * 1209 * @package WordPress 1210 * @subpackage Taxonomy 1211 * @since 2.3 1212 * @uses $wpdb 1213 * 1213 1214 * @param int $term The ID of the term 1214 1215 * @param string $taxonomy The context in which to relate the term to the object. … … 1301 1302 * @package WordPress 1302 1303 * @subpackage Taxonomy 1303 * @ category Term1304 * 1305 * @global $wpdb Database Object1304 * @since 2.3 1305 * @uses $wpdb 1306 * 1306 1307 * @param int|array $terms The ID of the terms 1307 1308 * @param string $taxonomy The context of the term. … … 1341 1342 1342 1343 /** 1343 * clean_object_term_cache() - 1344 * 1345 * 1346 * 1347 * @package WordPress 1348 * @subpackage Taxonomy 1349 * @category Cache 1350 * 1351 * @global $object_term_cache 1352 * @global $blog_id The id of the blog, in case there is more than one blog using the library. 1353 * @param int|array $object_ids 1354 * @param string $object_type @see get_object_taxonomies 1355 * @return null 1344 * clean_object_term_cache() - {@internal Missing Short Description}} 1345 * 1346 * {@internal Missing Long Description}} 1347 * 1348 * @package WordPress 1349 * @subpackage Taxonomy 1350 * @since 2.3 1351 * 1352 * @see get_object_taxonomies() for more on $object_type 1353 * 1354 * @param int|array $object_ids {@internal Missing Description}} 1355 * @param string $object_type {@internal Missing Description}} 1356 1356 */ 1357 1357 function clean_object_term_cache($object_ids, $object_type) { … … 1366 1366 1367 1367 /** 1368 * clean_term_cache() - 1369 * 1370 * 1371 * 1372 * @package WordPress 1373 * @subpackage Taxonomy 1374 * @category Cache 1375 * 1376 * @global $object_term_cache 1377 * @global $blog_id The id of the blog, in case there is more than one blog using the library. 1378 * @param int|array $ids 1368 * clean_term_cache() - {@internal Missing Short Description}} 1369 * 1370 * {@internal Missing Long Description}} 1371 * 1372 * @package WordPress 1373 * @subpackage Taxonomy 1374 * @since 2.3 1375 * @uses $wpdb 1376 * 1377 * @param int|array $ids {@internal Missing Description}} 1379 1378 * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. 1380 * @return null1381 1379 */ 1382 1380 function clean_term_cache($ids, $taxonomy = '') { … … 1414 1412 } 1415 1413 1414 /** 1415 * get_object_term_cache() - {@internal Missing Short Description}} 1416 * 1417 * {@internal Missing Long Description}} 1418 * 1419 * @package WordPress 1420 * @subpackage Taxonomy 1421 * @since 2.3 1422 * 1423 * @param int|array $ids {@internal Missing Description}} 1424 * @param string $taxonomy {@internal Missing Description}} 1425 * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. 1426 */ 1416 1427 function &get_object_term_cache($id, $taxonomy) { 1417 1428 $terms = wp_cache_get($id, 'object_terms'); … … 1426 1437 } 1427 1438 1439 /** 1440 * get_object_term_cache() - {@internal Missing Short Description}} 1441 * 1442 * {@internal Missing Long Description}} 1443 * 1444 * @package WordPress 1445 * @subpackage Taxonomy 1446 * @since 2.3 1447 * @uses $wpdb 1448 * 1449 * @param string|array $object_ids {@internal Missing Description}} 1450 * @param string $object_type {@internal Missing Description}} 1451 * @return null|array Null value is given with empty $object_ids. 1452 */ 1428 1453 function update_object_term_cache($object_ids, $object_type) { 1429 1454 global $wpdb; … … 1461 1486 } 1462 1487 1488 /** 1489 * update_term_cache() - Updates Terms to Taxonomy in cache. 1490 * 1491 * @package WordPress 1492 * @subpackage Taxonomy 1493 * @since 2.3 1494 * 1495 * @param array $terms List of Term objects to change 1496 * @param string $taxonomy Optional. Update Term to this taxonomy in cache 1497 */ 1463 1498 function update_term_cache($terms, $taxonomy = '') { 1464 1499 foreach ( $terms as $term ) { … … 1475 1510 // 1476 1511 1512 /** 1513 * _get_term_hierarchy() - Retrieves children of taxonomy 1514 * 1515 * {@internal Missing Long Description}} 1516 * 1517 * @package WordPress 1518 * @subpackage Taxonomy 1519 * @access private 1520 * @since 2.3 1521 * 1522 * @param string $taxonomy {@internal Missing Description}} 1523 * @return array Empty if $taxonomy isn't hierarachical or returns children. 1524 */ 1477 1525 function _get_term_hierarchy($taxonomy) { 1478 1526 if ( !is_taxonomy_hierarchical($taxonomy) ) … … 1494 1542 1495 1543 /** 1496 * @access private1497 1544 * _get_term_children() - Get array of child terms 1498 1545 * … … 1502 1549 * @package WordPress 1503 1550 * @subpackage Taxonomy 1551 * @access private 1552 * @since 2.3 1504 1553 * 1505 1554 * @param int $term_id Look for this Term ID in $terms 1506 1555 * @param array $terms List of Term IDs 1507 1556 * @param string $taxonomy Term Context 1508 * @return array 1557 * @return array Empty if $terms is empty else returns full list of child terms. 1509 1558 */ 1510 1559 function &_get_term_children($term_id, $terms, $taxonomy) { … … 1548 1597 1549 1598 /** 1550 * @access private1551 1599 * _pad_term_counts() - Add count of children to parent count 1552 1600 * … … 1556 1604 * @package WordPress 1557 1605 * @subpackage Taxonomy 1606 * @access private 1607 * @since 2.3 1608 * @uses $wpdb 1558 1609 * 1559 1610 * @param array $terms List of Term IDs 1560 1611 * @param string $taxonomy Term Context 1612 * @return null Will break from function if conditions are not met. 1561 1613 */ 1562 1614 function _pad_term_counts(&$terms, $taxonomy) { … … 1608 1660 1609 1661 /** 1610 * @access private1611 1662 * _update_post_term_count() - Will update term count based on posts 1612 1663 * … … 1615 1666 * @package WordPress 1616 1667 * @subpackage Taxonomy 1617 * @category Callback 1618 * 1619 * @global $wpdb Database Object 1668 * @access private 1669 * @since 2.3 1670 * @uses $wpdb 1671 * 1620 1672 * @param array $terms List of Term IDs 1621 1673 */
Note: See TracChangeset
for help on using the changeset viewer.