WordPress.org

Make WordPress Core

Ticket #4742: taxonomy.6277.phpdoc.patch

File taxonomy.6277.phpdoc.patch, 28.1 KB (added by darkdragon, 7 years ago)

Added @since tags to all functions, cleaned up and correct documentation, as well as added some documentation to functions. Still Incomplete.

  • taxonomy.php

     
    1010// 
    1111 
    1212/** 
    13  * @global array $wp_taxonomies Default Taxonomy Objects 
     13 * Default Taxonomy Objects 
     14 * @since 2.3 
     15 * @global array $wp_taxonomies 
    1416 */ 
    1517$wp_taxonomies = array(); 
    1618$wp_taxonomies['category'] = (object) array('name' => 'category', 'object_type' => 'post', 'hierarchical' => true, 'update_count_callback' => '_update_post_term_count'); 
     
    2325 * It appears that this function can be used to find all of the names inside of 
    2426 * $wp_taxonomies global variable. 
    2527 * 
    26  * @example 
    27  *      <?php $taxonomies = get_object_taxonomies('post'); ?> 
    28  *      Should result in <pre>Array( 
    29  *      'category', 
    30  *      'post_tag' 
    31  *      )</pre> 
     28 * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> 
     29 * Should result in <code>Array('category', 'post_tag')</code> 
    3230 * 
    3331 * @package WordPress 
    3432 * @subpackage Taxonomy 
     33 * @since 2.3 
    3534 *  
    36  * @global array $wp_taxonomies 
     35 * @uses $wp_taxonomies 
     36 * 
    3737 * @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. 
    4239 */ 
    4340function get_object_taxonomies($object_type) { 
    4441        global $wp_taxonomies; 
     
    5350} 
    5451 
    5552/** 
    56  * get_taxonomy() - Returns the "taxonomy" object of $taxonomy. 
     53 * get_taxonomy() - Returns the taxonomy object of $taxonomy. 
    5754 * 
    5855 * The get_taxonomy function will first check that the parameter string given 
    5956 * is a taxonomy object and if it is, it will return it. 
    6057 * 
    6158 * @package WordPress 
    6259 * @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 * 
    6565 * @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 
    7067 */ 
    7168function get_taxonomy( $taxonomy ) { 
    7269        global $wp_taxonomies; 
     
    8279 * 
    8380 * @package WordPress 
    8481 * @subpackage Taxonomy 
     82 * @since 2.3 
    8583 *  
    86  * @global array $wp_taxonomies 
     84 * @uses $wp_taxonomies 
     85 * 
    8786 * @param string $taxonomy Name of taxonomy object 
    8887 * @return bool Whether the taxonomy exists or not. 
    89  * 
    90  * @internal 
    91  *      This is all conjecture and might be partially or completely inaccurate. 
    9288 */ 
    9389function is_taxonomy( $taxonomy ) { 
    9490        global $wp_taxonomies; 
     
    106102 * 
    107103 * @package WordPress 
    108104 * @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 * 
    111110 * @param string $taxonomy Name of taxonomy object 
    112111 * @return bool Whether the taxonomy is hierarchical 
    113  * 
    114  * @internal 
    115  *      This is all conjecture and might be partially or completely inaccurate. 
    116112 */ 
    117113function is_taxonomy_hierarchical($taxonomy) { 
    118114        if ( ! is_taxonomy($taxonomy) ) 
     
    133129 * functions to still work. It is possible to overwrite the default set, which contains two 
    134130 * keys: hierarchical and update_count_callback. 
    135131 * 
    136  * hierarachical has some defined purpose at other parts of the API and is a boolean value. 
     132 * Nothing is returned, so expect error maybe or use is_taxonomy() to check whether taxonomy exists. 
    137133 * 
    138  * update_count_callback works much like a hook, in that it will be called (or something from 
    139  *      somewhere). 
     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. 
    140137 * 
    141138 * @package WordPress 
    142139 * @subpackage Taxonomy 
     140 * @since 2.3 
     141 * @uses $wp_taxonomies Inserts new taxonomy object into the list 
    143142 *  
    144  * @global array $wp_taxonomies 
    145143 * @param string $taxonomy Name of taxonomy object 
    146144 * @param string $object_type Name of the object type for the taxonomy object. 
    147145 * @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  * @internal 
    151  *      This is all conjecture and might be partially or completely inaccurate. 
    152146 */ 
    153147function register_taxonomy( $taxonomy, $object_type, $args = array() ) { 
    154148        global $wp_taxonomies; 
     
    181175 * 
    182176 * @package WordPress 
    183177 * @subpackage Taxonomy 
    184  * @category Term  
     178 * @since 2.3 
    185179 * 
    186  * @global object $wpdb Database Query 
     180 * @uses $wpdb 
     181 * @uses wp_parse_args() Creates an array from string $args. 
     182 * 
    187183 * @param string|array $terms String of term or array of string values of terms that will be used 
    188184 * @param string|array $taxonomies String of taxonomy name or Array of string values of taxonomy names 
    189185 * @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. 
    196188 */ 
    197189function get_objects_in_term( $terms, $taxonomies, $args = array() ) { 
    198190        global $wpdb; 
     
    232224 * 
    233225 * The usage of the get_term function is to apply filters to a term object. 
    234226 * It is possible to get a term object from the database before applying the 
    235  * filters.  
     227 * filters. 
    236228 * 
    237229 * $term ID must be part of $taxonomy, to get from the database. Failure, might be 
    238230 * able to be captured by the hooks. Failure would be the same value as $wpdb returns for the 
    239231 * get_row method. 
    240232 * 
    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. 
     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. 
    244236 * 
     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 * 
    245244 * @package WordPress 
    246245 * @subpackage Taxonomy 
    247  * @category Term  
     246 * @since 2.3 
    248247 * 
    249  * @global object $wpdb Database Query 
     248 * @uses $wpdb 
     249 * 
    250250 * @param int|object $term If integer, will get from database. If object will apply filters and return $term. 
    251251 * @param string $taxonomy Taxonomy name that $term is part of. 
    252252 * @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. 
    260256 */ 
    261257function &get_term($term, $taxonomy, $output = OBJECT, $filter = 'raw') { 
    262258        global $wpdb; 
     
    278274                } 
    279275        } 
    280276         
    281         /** 
    282          * @internal 
    283          * 
    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_term 
    288          * @hook-return object 
    289          * @hook-param object $_term The current term object 
    290          * @hook-param string $taxonomy What taxonomy the term is in. 
    291          */ 
    292277        $_term = apply_filters('get_term', $_term, $taxonomy); 
    293          
    294         /** 
    295          * @internal 
    296          * 
    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_$taxonomy 
    304          * @hook-return object 
    305          * @hook-param object $_term The current term object 
    306          * @hook-param string $taxonomy What taxonomy the term is in. 
    307          */ 
    308278        $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); 
    309279        $_term = sanitize_term($_term, $taxonomy, $filter); 
    310280 
     
    329299 * 
    330300 * If $value does not exist, the return value will be false. If $taxonomy exists and $field 
    331301 * and $value combinations exist, the Term will be returned. 
    332  *  
    333302 * 
    334303 * @package WordPress 
    335304 * @subpackage Taxonomy 
    336  * @category Term  
     305 * @since 2.3 
    337306 * 
    338  * @global object $wpdb Database Query 
     307 * @uses $wpdb 
     308 * 
    339309 * @param string $field Either 'slug', 'name', or 'id' 
    340310 * @param string|int $value Search for this term value 
    341311 * @param string $taxonomy Taxonomy Name 
    342312 * @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. 
    348315 */ 
    349316function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') { 
    350317        global $wpdb; 
     
    388355 * get_term_children() - Merge all term children into a single array. 
    389356 * 
    390357 * This recursive function will merge all of the children of $term into 
    391  * the same array. 
     358 * the same array. Only useful for taxonomies which are hierarchical. 
    392359 * 
    393  * Only useful for taxonomies which are hierarchical. 
     360 * Will return an empty array if $term does not exist in $taxonomy. 
    394361 *  
    395362 * @package WordPress 
    396363 * @subpackage Taxonomy 
    397  * @category Term  
     364 * @since 2.3 
    398365 * 
    399  * @global object $wpdb Database Query 
     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 * 
    400370 * @param string $term Name of Term to get children 
    401371 * @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 
    406373 */ 
    407374function get_term_children( $term, $taxonomy ) { 
    408375        if ( ! is_taxonomy($taxonomy) ) 
     
    432399 * 
    433400 * @package WordPress 
    434401 * @subpackage Taxonomy 
    435  * @category Term  
     402 * @since 2.3 
    436403 * 
     404 * @uses sanitize_term_field() Passes the return value in sanitize_term_field on success. 
     405 * 
    437406 * @param string $field Term field to fetch 
    438407 * @param int $term Term ID 
    439408 * @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. 
    445411 */ 
    446412function get_term_field( $field, $term, $taxonomy, $context = 'display' ) { 
    447413        $term = (int) $term; 
     
    466432 *  
    467433 * @package WordPress 
    468434 * @subpackage Taxonomy 
    469  * @category Term  
     435 * @since 2.3 
    470436 * 
     437 * @uses sanitize_term() Passes the return value on success 
     438 * 
    471439 * @param int|object $id Term ID or Object 
    472440 * @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. 
    477442 */ 
    478443function get_term_to_edit( $id, $taxonomy ) { 
    479444        $term = get_term( $id, $taxonomy ); 
     
    488453} 
    489454 
    490455/** 
    491  * get_terms() -  
     456 * get_terms() - Retrieve the terms in taxonomy or list of taxonomies. 
    492457 * 
    493  *  
    494  *  
     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 * 
    495491 * @package WordPress 
    496492 * @subpackage Taxonomy 
    497  * @category Term  
     493 * @since 2.3 
    498494 * 
     495 * @uses $wpdb 
     496 * @uses wp_parse_args() Merges the defaults with those defined by $args and allows for strings. 
     497 * 
    499498 * @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. 
    505501 */ 
    506502function &get_terms($taxonomies, $args = '') { 
    507503        global $wpdb; 
     
    683679 * 
    684680 * @package WordPress 
    685681 * @subpackage Taxonomy 
    686  * @category Term  
     682 * @since 2.3 
    687683 * 
    688  * @global $wpdb Database Object 
     684 * @uses $wpdb 
     685 * 
    689686 * @param int|string $term The term to check 
    690687 * @param string $taxonomy The taxonomy name to use 
    691688 * @return mixed Get the term id or Term Object, if exists. 
     
    720717 * 
    721718 * @package WordPress 
    722719 * @subpackage Taxonomy 
    723  * @category Term  
     720 * @since 2.3 
    724721 * 
     722 * @uses sanitize_term_field Used to sanitize all fields in a term 
     723 * 
    725724 * @param array|object $term The term to check 
    726725 * @param string $taxonomy The taxonomy name to use 
    727  * @param string $context Default is display 
     726 * @param string $context Default is 'display'. 
    728727 * @return array|object Term with all fields sanitized 
    729728 */ 
    730729function sanitize_term($term, $taxonomy, $context = 'display') { 
     
    745744} 
    746745 
    747746/** 
    748  * sanitize_term_field() -  
     747 * sanitize_term_field() - {@internal Missing Short Description}} 
    749748 * 
     749 * {@internal Missing Long Description}} 
    750750 * 
    751  * 
    752751 * @package WordPress 
    753752 * @subpackage Taxonomy 
    754  * @category Term  
     753 * @since 2.3 
    755754 * 
    756  * @global object $wpdb Database Object 
     755 * @uses $wpdb 
     756 * 
    757757 * @param string $field Term field to sanitize 
    758758 * @param string $value Search for this term value 
    759759 * @param int $term_id Term ID 
     
    800800/** 
    801801 * wp_count_terms() - Count how many terms are in Taxonomy 
    802802 * 
    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. 
     803 * Default $args is 'ignore_empty' which can be <code>'ignore_empty=true'</code> or 
     804 * <code>array('ignore_empty' => true);</code>. 
    806805 * 
    807806 * @package WordPress 
    808807 * @subpackage Taxonomy 
    809  * @category Term  
     808 * @since 2.3 
    810809 * 
    811  * @global object $wpdb Database Object 
     810 * @uses $wpdb 
     811 * @uses wp_parse_args() Turns strings into arrays and merges defaults into an array. 
     812 * 
    812813 * @param string $taxonomy Taxonomy name 
    813814 * @param array|string $args Overwrite defaults 
    814815 * @return int How many terms are in $taxonomy 
     
    829830} 
    830831 
    831832/** 
    832  * wp_delete_object_term_relationships() -  
     833 * wp_delete_object_term_relationships() - {@internal Missing Short Description}} 
    833834 * 
     835 * {@internal Missing Long Description}} 
    834836 * 
    835  * 
    836837 * @package WordPress 
    837838 * @subpackage Taxonomy 
    838  * @category Term  
     839 * @since 2.3 
     840 * @uses $wpdb 
    839841 * 
    840  * @global object $wpdb Database Object 
    841  * @param int $object_id ?? 
     842 * @param int $object_id The term Object Id that refers to the term 
    842843 * @param string|array $taxonomy List of Taxonomy Names or single Taxonomy name. 
    843844 */ 
    844845function wp_delete_object_term_relationships( $object_id, $taxonomies ) { 
     
    860861/** 
    861862 * wp_delete_term() - Removes a term from the database. 
    862863 * 
     864 * {@internal Missing Long Description}} 
    863865 * 
    864  * 
    865866 * @package WordPress 
    866867 * @subpackage Taxonomy 
    867  * @category Term  
     868 * @since 2.3 
     869 * @uses $wpdb 
    868870 * 
    869  * @global object $wpdb Database Object 
    870871 * @param int $term Term ID 
    871872 * @param string $taxonomy Taxonomy Name 
    872873 * @param array|string $args Change Default 
    873  * @param bool Returns false if not term; true if completes delete action. 
     874 * @return bool Returns false if not term; true if completes delete action. 
    874875 */ 
    875876function wp_delete_term( $term, $taxonomy, $args = array() ) { 
    876877        global $wpdb; 
     
    930931/** 
    931932 * wp_get_object_terms() - Returns the terms associated with the given object(s), in the supplied taxonomies. 
    932933 * 
    933  *  
     934 * {@internal Missing Long Description}} 
    934935 * 
    935936 * @package WordPress 
    936937 * @subpackage Taxonomy 
    937  * @category Term  
     938 * @since 2.3 
     939 * @uses $wpdb 
    938940 * 
    939  * @global $wpdb Database Object 
    940  * @param int|array $object_id The id of the object(s)) to retrieve for. 
     941 * @param int|array $object_id The id of the object(s)) to retrieve. 
    941942 * @param string|array $taxonomies The taxonomies to retrieve terms from. 
    942943 * @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. 
    944945 */ 
    945946function wp_get_object_terms($object_ids, $taxonomies, $args = array()) { 
    946947        global $wpdb; 
     
    998999/** 
    9991000 * wp_insert_term() - Adds a new term to the database. Optionally marks it as an alias of an existing term. 
    10001001 * 
    1001  *  
     1002 * {@internal Missing Long Description}} 
    10021003 * 
    10031004 * @package WordPress 
    10041005 * @subpackage Taxonomy 
    1005  * @category Term  
     1006 * @since 2.3 
     1007 * @uses $wpdb 
    10061008 * 
    1007  * @global $wpdb Database Object 
    10081009 * @param int|string $term The term to add or update. 
    10091010 * @param string $taxonomy The taxonomy to which to add the term 
    10101011 * @param array|string $args Change the values of the inserted term 
    1011  * @return array The Term ID and Term Taxonomy ID 
     1012 * @return array|WP_Error The Term ID and Term Taxonomy ID 
    10121013 */ 
    10131014function wp_insert_term( $term, $taxonomy, $args = array() ) { 
    10141015        global $wpdb; 
     
    10831084} 
    10841085 
    10851086/** 
    1086  * wp_set_object_terms() -  
     1087 * wp_set_object_terms() - {@internal Missing Short Description}} 
    10871088 *  
    10881089 * Relates an object (post, link etc) to a term and taxonomy type.  Creates the term and taxonomy 
    10891090 * relationship if it doesn't already exist.  Creates a term if it doesn't exist (using the slug). 
    10901091 * 
    10911092 * @package WordPress 
    10921093 * @subpackage Taxonomy 
    1093  * @category Term  
     1094 * @since 2.3 
     1095 * @uses $wpdb 
    10941096 * 
    1095  * @global $wpdb Database Object 
    10961097 * @param int $object_id The object to relate to. 
    10971098 * @param array|int|string $term The slug or id of the term. 
    10981099 * @param array|string $taxonomy The context in which to relate the term to the object. 
    10991100 * @param bool $append If false will delete difference of terms. 
    1100  * @return array Affected Term IDs 
     1101 * @return array|WP_Error Affected Term IDs 
    11011102 */ 
    11021103function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) { 
    11031104        global $wpdb; 
     
    11451146} 
    11461147 
    11471148/** 
    1148  * wp_unique_term_slug() - Will make @see $slug unique, if it isn't already 
     1149 * wp_unique_term_slug() - Will make slug unique, if it isn't already 
    11491150 *  
    1150  * The @see $slug has to be unique global to every taxonomy, meaning that one taxonomy 
     1151 * The $slug has to be unique global to every taxonomy, meaning that one taxonomy 
    11511152 * term can't have a matching slug with another taxonomy term. Each slug has to be 
    11521153 * globally unique for every taxonomy. 
    11531154 * 
    11541155 * 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. 
    11561157 * 
    11571158 * If that still doesn't return an unique slug, then it try to append a number until 
    11581159 * it finds a number that is truely unique. 
    11591160 *  
    1160  * The only purpose for @see $term is for appending a parent, if one exists. 
     1161 * The only purpose for $term is for appending a parent, if one exists. 
    11611162 * 
    11621163 * @package WordPress 
    11631164 * @subpackage Taxonomy 
    1164  * @category Term 
     1165 * @since 2.3 
     1166 * @uses $wpdb 
    11651167 * 
    1166  * @global $wpdb Database Object 
    11671168 * @param string $slug The string that will be tried for a unique slug 
    11681169 * @param object $term The term object that the $slug will belong too 
    11691170 * @return string Will return a true unique slug. 
     
    12011202} 
    12021203 
    12031204/** 
    1204  * wp_update_term() -  
    1205  *  
    1206  *  
     1205 * wp_update_term() - {@internal Missing Short Description}} 
    12071206 * 
     1207 * {@internal Missing Long Description}} 
     1208 * 
    12081209 * @package WordPress 
    12091210 * @subpackage Taxonomy 
    1210  * @category Term  
     1211 * @since 2.3 
     1212 * @uses $wpdb 
    12111213 * 
    1212  * @global $wpdb Database Object 
    12131214 * @param int $term The ID of the term 
    12141215 * @param string $taxonomy The context in which to relate the term to the object. 
    12151216 * @param array|string $args Overwrite defaults 
     
    13001301 * 
    13011302 * @package WordPress 
    13021303 * @subpackage Taxonomy 
    1303  * @category Term  
     1304 * @since 2.3 
     1305 * @uses $wpdb 
    13041306 * 
    1305  * @global $wpdb Database Object 
    13061307 * @param int|array $terms The ID of the terms 
    13071308 * @param string $taxonomy The context of the term. 
    13081309 * @return bool If no terms will return false, and if successful will return true. 
     
    13401341// 
    13411342 
    13421343/** 
    1343  * clean_object_term_cache() -  
    1344  *  
    1345  *  
     1344 * clean_object_term_cache() - {@internal Missing Short Description}} 
    13461345 * 
     1346 * {@internal Missing Long Description}} 
     1347 * 
    13471348 * @package WordPress 
    13481349 * @subpackage Taxonomy 
    1349  * @category Cache  
     1350 * @since 2.3 
    13501351 * 
    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 
     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}} 
    13561356 */ 
    13571357function clean_object_term_cache($object_ids, $object_type) { 
    13581358        if ( !is_array($object_ids) ) 
     
    13651365} 
    13661366 
    13671367/** 
    1368  * clean_term_cache() -  
    1369  *  
    1370  *  
     1368 * clean_term_cache() - {@internal Missing Short Description}} 
    13711369 * 
     1370 * {@internal Missing Long Description}} 
     1371 * 
    13721372 * @package WordPress 
    13731373 * @subpackage Taxonomy 
    1374  * @category Cache  
     1374 * @since 2.3 
     1375 * @uses $wpdb 
    13751376 * 
    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  
     1377 * @param int|array $ids {@internal Missing Description}} 
    13791378 * @param string $taxonomy Can be empty and will assume tt_ids, else will use for context. 
    1380  * @return null 
    13811379 */ 
    13821380function clean_term_cache($ids, $taxonomy = '') { 
    13831381        global $wpdb; 
     
    14131411        do_action('clean_term_cache', $ids, $taxonomy); 
    14141412} 
    14151413 
     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 */ 
    14161427function &get_object_term_cache($id, $taxonomy) { 
    14171428        $terms = wp_cache_get($id, 'object_terms'); 
    14181429        if ( false !== $terms ) { 
     
    14251436        return false; 
    14261437} 
    14271438 
     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 */ 
    14281453function update_object_term_cache($object_ids, $object_type) { 
    14291454        global $wpdb; 
    14301455 
     
    14601485                wp_cache_set($id, $value, 'object_terms'); 
    14611486} 
    14621487 
     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 */ 
    14631498function update_term_cache($terms, $taxonomy = '') { 
    14641499        foreach ( $terms as $term ) { 
    14651500                $term_taxonomy = $taxonomy; 
     
    14741509// Private 
    14751510// 
    14761511 
     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 */ 
    14771525function _get_term_hierarchy($taxonomy) { 
    14781526        if ( !is_taxonomy_hierarchical($taxonomy) ) 
    14791527                return array(); 
     
    14931541} 
    14941542 
    14951543/** 
    1496  * @access private 
    14971544 * _get_term_children() - Get array of child terms 
    14981545 *  
    14991546 * If $terms is an array of objects, then objects will returned from the function. 
     
    15011548 * 
    15021549 * @package WordPress 
    15031550 * @subpackage Taxonomy 
     1551 * @access private 
     1552 * @since 2.3 
    15041553 * 
    15051554 * @param int $term_id Look for this Term ID in $terms 
    15061555 * @param array $terms List of Term IDs 
    15071556 * @param string $taxonomy Term Context 
    1508  * @return array  
     1557 * @return array Empty if $terms is empty else returns full list of child terms. 
    15091558 */ 
    15101559function &_get_term_children($term_id, $terms, $taxonomy) { 
    15111560        if ( empty($terms) ) 
     
    15471596} 
    15481597 
    15491598/** 
    1550  * @access private 
    15511599 * _pad_term_counts() - Add count of children to parent count 
    15521600 *  
    15531601 * Recalculates term counts by including items from child terms. 
     
    15551603 * 
    15561604 * @package WordPress 
    15571605 * @subpackage Taxonomy 
     1606 * @access private 
     1607 * @since 2.3 
     1608 * @uses $wpdb 
    15581609 * 
    15591610 * @param array $terms List of Term IDs 
    15601611 * @param string $taxonomy Term Context 
     1612 * @return null Will break from function if conditions are not met. 
    15611613 */ 
    15621614function _pad_term_counts(&$terms, $taxonomy) { 
    15631615        global $wpdb; 
     
    16071659// 
    16081660 
    16091661/** 
    1610  * @access private 
    16111662 * _update_post_term_count() - Will update term count based on posts 
    16121663 *  
    16131664 * Private function for the default callback for post_tag and category taxonomies. 
    16141665 * 
    16151666 * @package WordPress 
    16161667 * @subpackage Taxonomy 
    1617  * @category Callback  
     1668 * @access private 
     1669 * @since 2.3 
     1670 * @uses $wpdb 
    16181671 * 
    1619  * @global $wpdb Database Object 
    16201672 * @param array $terms List of Term IDs 
    16211673 */ 
    16221674function _update_post_term_count( $terms ) {