WordPress.org

Make WordPress Core

Ticket #7038: taxonomy.phpdoc.r8159.diff

File taxonomy.phpdoc.r8159.diff, 35.7 KB (added by jacobsantos, 6 years ago)

Completion and phpdoc corrections to taxonomy based off of r8159

  • taxonomy.php

     
    2020$wp_taxonomies['link_category'] = (object) array('name' => 'link_category', 'object_type' => 'link', 'hierarchical' => false); 
    2121 
    2222/** 
    23  * get_object_taxonomies() - Return all of the taxonomy names that are of $object_type 
     23 * Return all of the taxonomy names that are of $object_type. 
    2424 * 
    2525 * It appears that this function can be used to find all of the names inside of 
    2626 * $wp_taxonomies global variable. 
    2727 * 
    28  * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> 
    29  * Should result in <code>Array('category', 'post_tag')</code> 
     28 * <code><?php $taxonomies = get_object_taxonomies('post'); ?></code> Should 
     29 * result in <code>Array('category', 'post_tag')</code> 
    3030 * 
    3131 * @package WordPress 
    3232 * @subpackage Taxonomy 
     
    5858} 
    5959 
    6060/** 
    61  * get_taxonomy() - Returns the taxonomy object of $taxonomy. 
     61 * Retrieves the taxonomy object of $taxonomy. 
    6262 * 
    6363 * The get_taxonomy function will first check that the parameter string given 
    6464 * is a taxonomy object and if it is, it will return it. 
     
    8383} 
    8484 
    8585/** 
    86  * is_taxonomy() - Checks that the taxonomy name exists 
     86 * Checks that the taxonomy name exists. 
    8787 * 
    8888 * @package WordPress 
    8989 * @subpackage Taxonomy 
     
    101101} 
    102102 
    103103/** 
    104  * is_taxonomy_hierarchical() - Whether the taxonomy object is hierarchical 
     104 * Whether the taxonomy object is hierarchical. 
    105105 * 
    106  * Checks to make sure that the taxonomy is an object first. Then Gets the object, and finally 
    107  * returns the hierarchical value in the object. 
     106 * Checks to make sure that the taxonomy is an object first. Then Gets the 
     107 * object, and finally returns the hierarchical value in the object. 
    108108 * 
    109109 * A false return value might also mean that the taxonomy does not exist. 
    110110 * 
     
    127127} 
    128128 
    129129/** 
    130  * register_taxonomy() - Create or modify a taxonomy object. Do not use before init. 
     130 * Create or modify a taxonomy object. Do not use before init. 
    131131 * 
    132  * A simple function for creating or modifying a taxonomy object based on the parameters given. 
    133  * The function will accept an array (third optional parameter), along with strings for the 
    134  * taxonomy name and another string for the object type. 
     132 * A simple function for creating or modifying a taxonomy object based on the 
     133 * parameters given. The function will accept an array (third optional 
     134 * parameter), along with strings for the taxonomy name and another string for 
     135 * the object type. 
    135136 * 
    136  * Nothing is returned, so expect error maybe or use is_taxonomy() to check whether taxonomy exists. 
     137 * Nothing is returned, so expect error maybe or use is_taxonomy() to check 
     138 * whether taxonomy exists. 
    137139 * 
    138140 * Optional $args contents: 
    139  * hierarachical - has some defined purpose at other parts of the API and is a boolean value. 
    140  * update_count_callback - works much like a hook, in that it will be called when the count is updated. 
    141  * rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize permastruct; default will use $taxonomy as slug 
    142  * query_var - false to prevent queries, or string to customize query var (?$query_var=$term); default will use $taxonomy as query var 
    143141 * 
     142 * hierarachical - has some defined purpose at other parts of the API and is a 
     143 * boolean value. 
     144 * 
     145 * update_count_callback - works much like a hook, in that it will be called 
     146 * when the count is updated. 
     147 * 
     148 * rewrite - false to prevent rewrite, or array('slug'=>$slug) to customize 
     149 * permastruct; default will use $taxonomy as slug. 
     150 * 
     151 * query_var - false to prevent queries, or string to customize query var 
     152 * (?$query_var=$term); default will use $taxonomy as query var. 
     153 * 
    144154 * @package WordPress 
    145155 * @subpackage Taxonomy 
    146156 * @since 2.3 
     
    184194// 
    185195 
    186196/** 
    187  * get_objects_in_term() - Return object_ids of valid taxonomy and term 
     197 * Retrieve object_ids of valid taxonomy and term. 
    188198 * 
    189  * The strings of $taxonomies must exist before this function will continue. On failure of finding 
    190  * a valid taxonomy, it will return an WP_Error class, kind of like Exceptions in PHP 5, except you 
    191  * can't catch them. Even so, you can still test for the WP_Error class and get the error message. 
     199 * The strings of $taxonomies must exist before this function will continue. On 
     200 * failure of finding a valid taxonomy, it will return an WP_Error class, kind 
     201 * of like Exceptions in PHP 5, except you can't catch them. Even so, you can 
     202 * still test for the WP_Error class and get the error message. 
    192203 * 
    193  * The $terms aren't checked the same as $taxonomies, but still need to exist for $object_ids to 
    194  * be returned. 
     204 * The $terms aren't checked the same as $taxonomies, but still need to exist 
     205 * for $object_ids to be returned. 
    195206 * 
    196  * It is possible to change the order that object_ids is returned by either using PHP sort family 
    197  * functions or using the database by using $args with either ASC or DESC array. The value should 
    198  * be in the key named 'order'. 
     207 * It is possible to change the order that object_ids is returned by either 
     208 * using PHP sort family functions or using the database by using $args with 
     209 * either ASC or DESC array. The value should be in the key named 'order'. 
    199210 * 
    200211 * @package WordPress 
    201212 * @subpackage Taxonomy 
     
    244255} 
    245256 
    246257/** 
    247  * get_term() - Get all Term data from database by Term ID. 
     258 * Get all Term data from database by Term ID. 
    248259 * 
    249  * The usage of the get_term function is to apply filters to a term object. 
    250  * It is possible to get a term object from the database before applying the 
     260 * The usage of the get_term function is to apply filters to a term object. It 
     261 * is possible to get a term object from the database before applying the 
    251262 * filters. 
    252263 * 
    253  * $term ID must be part of $taxonomy, to get from the database. Failure, might be 
    254  * able to be captured by the hooks. Failure would be the same value as $wpdb returns for the 
    255  * get_row method. 
     264 * $term ID must be part of $taxonomy, to get from the database. Failure, might 
     265 * be able to be captured by the hooks. Failure would be the same value as $wpdb 
     266 * returns for the get_row method. 
    256267 * 
    257  * There are two hooks, one is specifically for each term, named 'get_term', and the second is 
    258  * for the taxonomy name, 'term_$taxonomy'. Both hooks gets the term object, and the taxonomy 
    259  * name as parameters. Both hooks are expected to return a Term object. 
     268 * There are two hooks, one is specifically for each term, named 'get_term', and 
     269 * the second is for the taxonomy name, 'term_$taxonomy'. Both hooks gets the 
     270 * term object, and the taxonomy name as parameters. Both hooks are expected to 
     271 * return a Term object. 
    260272 * 
    261  * 'get_term' hook - Takes two parameters the term Object and the taxonomy name. Must return 
    262  * term object. Used in get_term() as a catch-all filter for every $term. 
     273 * 'get_term' hook - Takes two parameters the term Object and the taxonomy name. 
     274 * Must return term object. Used in get_term() as a catch-all filter for every 
     275 * $term. 
    263276 * 
    264  * 'get_$taxonomy' hook - Takes two parameters the term Object and the taxonomy name. Must return 
    265  * term object. $taxonomy will be the taxonomy name, so for example, if 'category', it would be 
    266  * 'get_category' as the filter name. Useful for custom taxonomies or plugging into default taxonomies. 
     277 * 'get_$taxonomy' hook - Takes two parameters the term Object and the taxonomy 
     278 * name. Must return term object. $taxonomy will be the taxonomy name, so for 
     279 * example, if 'category', it would be 'get_category' as the filter name. Useful 
     280 * for custom taxonomies or plugging into default taxonomies. 
    267281 * 
    268282 * @package WordPress 
    269283 * @subpackage Taxonomy 
     
    316330} 
    317331 
    318332/** 
    319  * get_term_by() - Get all Term data from database by Term field and data. 
     333 * Get all Term data from database by Term field and data. 
    320334 * 
    321  * Warning: $value is not escaped for 'name' $field. You must do it yourself, if required. 
     335 * Warning: $value is not escaped for 'name' $field. You must do it yourself, if 
     336 * required. 
    322337 * 
    323  * The default $field is 'id', therefore it is possible to also use null for field, but not 
    324  * recommended that you do so. 
     338 * The default $field is 'id', therefore it is possible to also use null for 
     339 * field, but not recommended that you do so. 
    325340 * 
    326  * If $value does not exist, the return value will be false. If $taxonomy exists and $field 
    327  * and $value combinations exist, the Term will be returned. 
     341 * If $value does not exist, the return value will be false. If $taxonomy exists 
     342 * and $field and $value combinations exist, the Term will be returned. 
    328343 * 
    329344 * @package WordPress 
    330345 * @subpackage Taxonomy 
     
    380395} 
    381396 
    382397/** 
    383  * get_term_children() - Merge all term children into a single array. 
     398 * Merge all term children into a single array. 
    384399 * 
    385  * This recursive function will merge all of the children of $term into 
    386  * the same array. Only useful for taxonomies which are hierarchical. 
     400 * This recursive function will merge all of the children of $term into the same 
     401 * array. Only useful for taxonomies which are hierarchical. 
    387402 * 
    388403 * Will return an empty array if $term does not exist in $taxonomy. 
    389404 * 
     
    419434} 
    420435 
    421436/** 
    422  * get_term_field() - Get sanitized Term field 
     437 * Get sanitized Term field. 
    423438 * 
    424  * Does checks for $term, based on the $taxonomy. The function is for 
    425  * contextual reasons and for simplicity of usage. See sanitize_term_field() for 
    426  * more information. 
     439 * Does checks for $term, based on the $taxonomy. The function is for contextual 
     440 * reasons and for simplicity of usage. See sanitize_term_field() for more 
     441 * information. 
    427442 * 
    428443 * @package WordPress 
    429444 * @subpackage Taxonomy 
     
    453468} 
    454469 
    455470/** 
    456  * get_term_to_edit() - Sanitizes Term for editing 
     471 * Sanitizes Term for editing. 
    457472 * 
    458  * Return value is sanitize_term() and usage is for sanitizing the term 
    459  * for editing. Function is for contextual and simplicity. 
     473 * Return value is sanitize_term() and usage is for sanitizing the term for 
     474 * editing. Function is for contextual and simplicity. 
    460475 * 
    461476 * @package WordPress 
    462477 * @subpackage Taxonomy 
     
    481496} 
    482497 
    483498/** 
    484  * get_terms() - Retrieve the terms in taxonomy or list of taxonomies. 
     499 * Retrieve the terms in taxonomy or list of taxonomies. 
    485500 * 
    486  * You can fully inject any customizations to the query before it is sent, as well as control 
    487  * the output with a filter. 
     501 * You can fully inject any customizations to the query before it is sent, as 
     502 * well as control the output with a filter. 
    488503 * 
    489  * The 'get_terms' filter will be called when the cache has the term and will pass the found 
    490  * term along with the array of $taxonomies and array of $args. This filter is also called 
    491  * before the array of terms is passed and will pass the array of terms, along with the $taxonomies 
    492  * and $args. 
     504 * The 'get_terms' filter will be called when the cache has the term and will 
     505 * pass the found term along with the array of $taxonomies and array of $args. 
     506 * This filter is also called before the array of terms is passed and will pass 
     507 * the array of terms, along with the $taxonomies and $args. 
    493508 * 
    494  * The 'list_terms_exclusions' filter passes the compiled exclusions along with the $args. 
     509 * The 'list_terms_exclusions' filter passes the compiled exclusions along with 
     510 * the $args. 
    495511 * 
    496512 * The list that $args can contain, which will overwrite the defaults. 
    497  * orderby - Default is 'name'. Can be name, count, or nothing (will use term_id). 
     513 * 
     514 * orderby - Default is 'name'. Can be name, count, or nothing (will use 
     515 * term_id). 
     516 * 
    498517 * order - Default is ASC. Can use DESC. 
    499518 * hide_empty - Default is true. Will not return empty $terms. 
    500519 * fields - Default is all. 
     
    502521 * hierarchical - Whether to return hierarchical taxonomy. Default is true. 
    503522 * name__like - Default is empty string. 
    504523 * 
    505  * The argument 'pad_counts' will count all of the children along with the $terms. 
     524 * The argument 'pad_counts' will count all of the children along with the 
     525 * $terms. 
    506526 * 
    507  * The 'get' argument allows for overwriting 'hide_empty' and 'child_of', which can be done by 
    508  * setting the value to 'all', instead of its default empty string value. 
     527 * The 'get' argument allows for overwriting 'hide_empty' and 'child_of', which 
     528 * can be done by setting the value to 'all', instead of its default empty 
     529 * string value. 
    509530 * 
    510  * The 'child_of' argument will be used if you use multiple taxonomy or the first $taxonomy 
    511  * isn't hierarchical or 'parent' isn't used. The default is 0, which will be translated to 
    512  * a false value. If 'child_of' is set, then 'child_of' value will be tested against 
    513  * $taxonomy to see if 'child_of' is contained within. Will return an empty array if test 
    514  * fails. 
     531 * The 'child_of' argument will be used if you use multiple taxonomy or the 
     532 * first $taxonomy isn't hierarchical or 'parent' isn't used. The default is 0, 
     533 * which will be translated to a false value. If 'child_of' is set, then 
     534 * 'child_of' value will be tested against $taxonomy to see if 'child_of' is 
     535 * contained within. Will return an empty array if test fails. 
    515536 * 
    516  * If 'parent' is set, then it will be used to test against the first taxonomy. Much like 
    517  * 'child_of'. Will return an empty array if the test fails. 
     537 * If 'parent' is set, then it will be used to test against the first taxonomy. 
     538 * Much like 'child_of'. Will return an empty array if the test fails. 
    518539 * 
    519540 * @package WordPress 
    520541 * @subpackage Taxonomy 
     
    523544 * @uses $wpdb 
    524545 * @uses wp_parse_args() Merges the defaults with those defined by $args and allows for strings. 
    525546 * 
    526  * 
    527547 * @param string|array Taxonomy name or list of Taxonomy names 
    528548 * @param string|array $args The values of what to search for when returning terms 
    529549 * @return array|WP_Error List of Term Objects and their children. Will return WP_Error, if any of $taxonomies do not exist. 
     
    723743} 
    724744 
    725745/** 
    726  * is_term() - Check if Term exists 
     746 * Check if Term exists. 
    727747 * 
    728748 * Returns the index of a defined term, or 0 (false) if the term doesn't exist. 
    729749 * 
     
    757777} 
    758778 
    759779/** 
    760  * sanitize_term() - Sanitize Term all fields 
     780 * Sanitize Term all fields. 
    761781 * 
    762  * Relys on sanitize_term_field() to sanitize the term. The difference 
    763  * is that this function will sanitize <strong>all</strong> fields. The context 
    764  * is based on sanitize_term_field(). 
     782 * Relys on sanitize_term_field() to sanitize the term. The difference is that 
     783 * this function will sanitize <strong>all</strong> fields. The context is based 
     784 * on sanitize_term_field(). 
    765785 * 
    766786 * The $term is expected to be either an array or an object. 
    767787 * 
     
    798818} 
    799819 
    800820/** 
    801  * sanitize_term_field() - Cleanse the field value in the term based on the context 
     821 * Cleanse the field value in the term based on the context. 
    802822 * 
    803  * Passing a term field value through the function should be assumed to have cleansed 
    804  * the value for whatever context the term field is going to be used. 
     823 * Passing a term field value through the function should be assumed to have 
     824 * cleansed the value for whatever context the term field is going to be used. 
    805825 * 
    806  * If no context or an unsupported context is given, then default filters will be applied. 
     826 * If no context or an unsupported context is given, then default filters will 
     827 * be applied. 
    807828 * 
    808  * There are enough filters for each context to support a custom filtering without creating 
    809  * your own filter function. Simply create a function that hooks into the filter you need. 
     829 * There are enough filters for each context to support a custom filtering 
     830 * without creating your own filter function. Simply create a function that 
     831 * hooks into the filter you need. 
    810832 * 
    811833 * @package WordPress 
    812834 * @subpackage Taxonomy 
     
    863885} 
    864886 
    865887/** 
    866  * wp_count_terms() - Count how many terms are in Taxonomy 
     888 * Count how many terms are in Taxonomy. 
    867889 * 
    868  * Default $args is 'ignore_empty' which can be <code>'ignore_empty=true'</code> or 
    869  * <code>array('ignore_empty' => true);</code>. 
     890 * Default $args is 'ignore_empty' which can be <code>'ignore_empty=true'</code> 
     891 * or <code>array('ignore_empty' => true);</code>. 
    870892 * 
    871893 * @package WordPress 
    872894 * @subpackage Taxonomy 
     
    894916} 
    895917 
    896918/** 
    897  * wp_delete_object_term_relationships() - Will unlink the term from the taxonomy 
     919 * Will unlink the term from the taxonomy. 
    898920 * 
    899  * Will remove the term's relationship to the taxonomy, not the term or taxonomy itself. 
    900  * The term and taxonomy will still exist. Will require the term's object ID to perform 
    901  * the operation. 
     921 * Will remove the term's relationship to the taxonomy, not the term or taxonomy 
     922 * itself. The term and taxonomy will still exist. Will require the term's 
     923 * object ID to perform the operation. 
    902924 * 
    903925 * @package WordPress 
    904926 * @subpackage Taxonomy 
     
    925947} 
    926948 
    927949/** 
    928  * wp_delete_term() - Removes a term from the database. 
     950 * Removes a term from the database. 
    929951 * 
    930  * If the term is a parent of other terms, then the children will be updated 
    931  * to that term's parent. 
     952 * If the term is a parent of other terms, then the children will be updated to 
     953 * that term's parent. 
    932954 * 
    933955 * The $args 'default' will only override the terms found, if there is only one 
    934956 * term found. Any other and the found terms are used. 
     
    938960 * @since 2.3 
    939961 * 
    940962 * @uses $wpdb 
    941  * @uses do_action() Calls both 'delete_term' and 'delete_$taxonomy' action hooks, 
    942  *      passing term object, term id. 'delete_term' gets an additional parameter with 
    943  *      the $taxonomy parameter. 
     963 * @uses do_action() Calls both 'delete_term' and 'delete_$taxonomy' action 
     964 *      hooks, passing term object, term id. 'delete_term' gets an additional 
     965 *      parameter with the $taxonomy parameter. 
    944966 * 
    945967 * @param int $term Term ID 
    946968 * @param string $taxonomy Taxonomy Name 
     
    10061028} 
    10071029 
    10081030/** 
    1009  * wp_get_object_terms() - Retrieves the terms associated with the given object(s), in the supplied taxonomies. 
     1031 * Retrieves the terms associated with the given object(s), in the supplied taxonomies. 
    10101032 * 
    1011  * The following information has to do the $args parameter and for what can be contained in the string 
    1012  * or array of that parameter, if it exists. 
     1033 * The following information has to do the $args parameter and for what can be 
     1034 * contained in the string or array of that parameter, if it exists. 
    10131035 * 
    1014  * The first argument is called, 'orderby' and has the default value of 'name'. The other value that is 
    1015  * supported is 'count'. 
     1036 * The first argument is called, 'orderby' and has the default value of 'name'. 
     1037 * The other value that is supported is 'count'. 
    10161038 * 
    1017  * The second argument is called, 'order' and has the default value of 'ASC'. The only other value that 
    1018  * will be acceptable is 'DESC'. 
     1039 * The second argument is called, 'order' and has the default value of 'ASC'. 
     1040 * The only other value that will be acceptable is 'DESC'. 
    10191041 * 
    1020  * The final argument supported is called, 'fields' and has the default value of 'all'. There are 
    1021  * multiple other options that can be used instead. Supported values are as follows: 'all', 'ids', 
    1022  * 'names', and finally 'all_with_object_id'. 
     1042 * The final argument supported is called, 'fields' and has the default value of 
     1043 * 'all'. There are multiple other options that can be used instead. Supported 
     1044 * values are as follows: 'all', 'ids', 'names', and finally 
     1045 * 'all_with_object_id'. 
    10231046 * 
    1024  * The fields argument also decides what will be returned. If 'all' or 'all_with_object_id' is choosen or 
    1025  * the default kept intact, then all matching terms objects will be returned. If either 'ids' or 'names' 
    1026  * is used, then an array of all matching term ids or term names will be returned respectively. 
     1047 * The fields argument also decides what will be returned. If 'all' or 
     1048 * 'all_with_object_id' is choosen or the default kept intact, then all matching 
     1049 * terms objects will be returned. If either 'ids' or 'names' is used, then an 
     1050 * array of all matching term ids or term names will be returned respectively. 
    10271051 * 
    10281052 * @package WordPress 
    10291053 * @subpackage Taxonomy 
     
    11141138} 
    11151139 
    11161140/** 
    1117  * wp_insert_term() - Adds a new term to the database. Optionally marks it as an alias of an existing term. 
     1141 * Adds a new term to the database. Optionally marks it as an alias of an existing term. 
    11181142 * 
    1119  * Error handling is assigned for the nonexistance of the $taxonomy and $term parameters before inserting. 
    1120  * If both the term id and taxonomy exist previously, then an array will be returned that contains the term 
    1121  * id and the contents of what is returned. The keys of the array are 'term_id' and 'term_taxonomy_id' containing 
    1122  * numeric values. 
     1143 * Error handling is assigned for the nonexistance of the $taxonomy and $term 
     1144 * parameters before inserting. If both the term id and taxonomy exist 
     1145 * previously, then an array will be returned that contains the term id and the 
     1146 * contents of what is returned. The keys of the array are 'term_id' and 
     1147 * 'term_taxonomy_id' containing numeric values. 
    11231148 * 
    1124  * It is assumed that the term does not yet exist or the above will apply. The term will be first added to the term 
    1125  * table and then related to the taxonomy if everything is well. If everything is correct, then several actions 
    1126  * will be run prior to a filter and then several actions will be run after the filter is run. 
     1149 * It is assumed that the term does not yet exist or the above will apply. The 
     1150 * term will be first added to the term table and then related to the taxonomy 
     1151 * if everything is well. If everything is correct, then several actions will be 
     1152 * run prior to a filter and then several actions will be run after the filter 
     1153 * is run. 
    11271154 * 
    1128  * The arguments decide how the term is handled based on the $args parameter. The following 
    1129  * is a list of the available overrides and the defaults. 
     1155 * The arguments decide how the term is handled based on the $args parameter. 
     1156 * The following is a list of the available overrides and the defaults. 
    11301157 * 
    1131  * 'alias_of'. There is no default, but if added, expected is the slug that the term will be an alias of. 
    1132  * Expected to be a string. 
     1158 * 'alias_of'. There is no default, but if added, expected is the slug that the 
     1159 * term will be an alias of. Expected to be a string. 
    11331160 * 
    1134  * 'description'. There is no default. If exists, will be added to the database along with the term. Expected 
    1135  * to be a string. 
     1161 * 'description'. There is no default. If exists, will be added to the database 
     1162 * along with the term. Expected to be a string. 
    11361163 * 
    1137  * 'parent'. Expected to be numeric and default is 0 (zero). Will assign value of 'parent' to the term. 
     1164 * 'parent'. Expected to be numeric and default is 0 (zero). Will assign value 
     1165 * of 'parent' to the term. 
    11381166 * 
    11391167 * 'slug'. Expected to be a string. There is no default. 
    11401168 * 
    1141  * If 'slug' argument exists then the slug will be checked to see if it is not a valid term. If that check 
    1142  * succeeds (it is not a valid term), then it is added and the term id is given. If it fails, then a check 
    1143  * is made to whether the taxonomy is hierarchical and the parent argument is not empty. If the second check 
    1144  * succeeds, the term will be inserted and the term id will be given. 
     1169 * If 'slug' argument exists then the slug will be checked to see if it is not 
     1170 * a valid term. If that check succeeds (it is not a valid term), then it is 
     1171 * added and the term id is given. If it fails, then a check is made to whether 
     1172 * the taxonomy is hierarchical and the parent argument is not empty. If the 
     1173 * second check succeeds, the term will be inserted and the term id will be 
     1174 * given. 
    11451175 * 
    11461176 * @package WordPress 
    11471177 * @subpackage Taxonomy 
     
    12351265} 
    12361266 
    12371267/** 
    1238  * wp_set_object_terms() - Create Term and Taxonomy Relationships 
     1268 * Create Term and Taxonomy Relationships. 
    12391269 * 
    1240  * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy 
    1241  * relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug). 
     1270 * Relates an object (post, link etc) to a term and taxonomy type. Creates the 
     1271 * term and taxonomy relationship if it doesn't already exist. Creates a term if 
     1272 * it doesn't exist (using the slug). 
    12421273 * 
    1243  * A relationship means that the term is grouped in or belongs to the taxonomy. A term has no 
    1244  * meaning until it is given context by defining which taxonomy it exists under. 
     1274 * A relationship means that the term is grouped in or belongs to the taxonomy. 
     1275 * A term has no meaning until it is given context by defining which taxonomy it 
     1276 * exists under. 
    12451277 * 
    12461278 * @package WordPress 
    12471279 * @subpackage Taxonomy 
     
    13151347} 
    13161348 
    13171349/** 
    1318  * wp_unique_term_slug() - Will make slug unique, if it isn't already 
     1350 * Will make slug unique, if it isn't already. 
    13191351 * 
    1320  * The $slug has to be unique global to every taxonomy, meaning that one taxonomy 
    1321  * term can't have a matching slug with another taxonomy term. Each slug has to be 
    1322  * globally unique for every taxonomy. 
     1352 * The $slug has to be unique global to every taxonomy, meaning that one 
     1353 * taxonomy term can't have a matching slug with another taxonomy term. Each 
     1354 * slug has to be globally unique for every taxonomy. 
    13231355 * 
    1324  * The way this works is that if the taxonomy that the term belongs to is heirarchical 
    1325  * and has a parent, it will append that parent to the $slug. 
     1356 * The way this works is that if the taxonomy that the term belongs to is 
     1357 * heirarchical and has a parent, it will append that parent to the $slug. 
    13261358 * 
    1327  * If that still doesn't return an unique slug, then it try to append a number until 
    1328  * it finds a number that is truely unique. 
     1359 * If that still doesn't return an unique slug, then it try to append a number 
     1360 * until it finds a number that is truely unique. 
    13291361 * 
    13301362 * The only purpose for $term is for appending a parent, if one exists. 
    13311363 * 
     
    13761408} 
    13771409 
    13781410/** 
    1379  * wp_update_term() - Update term based on arguments provided 
     1411 * Update term based on arguments provided. 
    13801412 * 
    1381  * The $args will indiscriminately override all values with the same field name. Care 
    1382  * must be taken to not override important information need to update or update will 
    1383  * fail (or perhaps create a new term, neither would be acceptable). 
     1413 * The $args will indiscriminately override all values with the same field name. 
     1414 * Care must be taken to not override important information need to update or 
     1415 * update will fail (or perhaps create a new term, neither would be acceptable). 
    13841416 * 
    1385  * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not defined 
    1386  * in $args already. 
     1417 * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not 
     1418 * defined in $args already. 
    13871419 * 
    1388  * 'alias_of' will create a term group, if it doesn't already exist, and update it for 
    1389  * the $term. 
     1420 * 'alias_of' will create a term group, if it doesn't already exist, and update 
     1421 * it for the $term. 
    13901422 * 
    1391  * If the 'slug' argument in $args is missing, then the 'name' in $args will be used. 
    1392  * It should also be noted that if you set 'slug' and it isn't unique then a WP_Error 
    1393  * will be passed back. If you don't pass any slug, then a unique one will be created 
    1394  * for you. 
     1423 * If the 'slug' argument in $args is missing, then the 'name' in $args will be 
     1424 * used. It should also be noted that if you set 'slug' and it isn't unique then 
     1425 * a WP_Error will be passed back. If you don't pass any slug, then a unique one 
     1426 * will be created for you. 
    13951427 * 
    1396  * For what can be overrode in $args, check the term scheme can contain and stay away 
    1397  * from the term keys. 
     1428 * For what can be overrode in $args, check the term scheme can contain and stay 
     1429 * away from the term keys. 
    13981430 * 
    13991431 * @package WordPress 
    14001432 * @subpackage Taxonomy 
     
    14021434 * 
    14031435 * @uses $wpdb 
    14041436 * @uses do_action() Will call both 'edit_term' and 'edit_$taxonomy' twice. 
    1405  * @uses apply_filters() Will call the 'term_id_filter' filter and pass the term id and 
    1406  *      taxonomy id. 
     1437 * @uses apply_filters() Will call the 'term_id_filter' filter and pass the term 
     1438 *      id and taxonomy id. 
    14071439 * 
    14081440 * @param int $term The ID of the term 
    14091441 * @param string $taxonomy The context in which to relate the term to the object. 
     
    14891521        return array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id); 
    14901522} 
    14911523 
    1492 // enable or disable term count deferring 
    1493 // if no value is supplied, the current value of the defer setting is returned 
     1524/** 
     1525 * Enable or disable term counting. 
     1526 * 
     1527 * @since 2.6 
     1528 * 
     1529 * @param bool $defer Optional. 
     1530 * @return bool 
     1531 */ 
    14941532function wp_defer_term_counting($defer=NULL) { 
    14951533        static $_defer = false; 
    14961534 
     
    15051543} 
    15061544 
    15071545/** 
    1508  * wp_update_term_count() - Updates the amount of terms in taxonomy 
     1546 * Updates the amount of terms in taxonomy. 
    15091547 * 
    1510  * If there is a taxonomy callback applyed, then it will be called for updating the count. 
     1548 * If there is a taxonomy callback applyed, then it will be called for updating 
     1549 * the count. 
    15111550 * 
    1512  * The default action is to count what the amount of terms have the relationship of term ID. 
    1513  * Once that is done, then update the database. 
     1551 * The default action is to count what the amount of terms have the relationship 
     1552 * of term ID. Once that is done, then update the database. 
    15141553 * 
    15151554 * @package WordPress 
    15161555 * @subpackage Taxonomy 
     
    15471586        return wp_update_term_count_now( $terms, $taxonomy ); 
    15481587} 
    15491588 
     1589/** 
     1590 * Perform term count update immediately. 
     1591 * 
     1592 * @since 2.6 
     1593 * 
     1594 * @param array $terms IDs of Terms to update. 
     1595 * @param string $taxonomy The context of the term. 
     1596 * @return bool Always true when complete. 
     1597 */ 
    15501598function wp_update_term_count_now( $terms, $taxonomy ) { 
    15511599        global $wpdb; 
    15521600 
     
    15731621// Cache 
    15741622// 
    15751623 
     1624 
    15761625/** 
    1577  * clean_object_term_cache() - Removes the taxonomy relationship to terms from the cache. 
     1626 * Removes the taxonomy relationship to terms from the cache. 
    15781627 * 
    1579  * Will remove the entire taxonomy relationship containing term $object_id. The term IDs 
    1580  * have to exist within the taxonomy $object_type for the deletion to take place. 
     1628 * Will remove the entire taxonomy relationship containing term $object_id. The 
     1629 * term IDs have to exist within the taxonomy $object_type for the deletion to 
     1630 * take place. 
    15811631 * 
    15821632 * @package WordPress 
    15831633 * @subpackage Taxonomy 
     
    16011651        do_action('clean_object_term_cache', $object_ids, $object_type); 
    16021652} 
    16031653 
     1654 
    16041655/** 
    1605  * clean_term_cache() - Will remove all of the term ids from the cache 
     1656 * Will remove all of the term ids from the cache. 
    16061657 * 
    16071658 * @package WordPress 
    16081659 * @subpackage Taxonomy 
     
    16461697        do_action('clean_term_cache', $ids, $taxonomy); 
    16471698} 
    16481699 
     1700 
    16491701/** 
    1650  * get_object_term_cache() - Retrieves the taxonomy relationship to the term object id. 
     1702 * Retrieves the taxonomy relationship to the term object id. 
    16511703 * 
    16521704 * @package WordPress 
    16531705 * @subpackage Taxonomy 
     
    16641716        return $cache; 
    16651717} 
    16661718 
     1719 
    16671720/** 
    1668  * update_object_term_cache() - Updates the cache for Term ID(s) 
     1721 * Updates the cache for Term ID(s). 
    16691722 * 
    16701723 * Will only update the cache for terms not already cached. 
    16711724 * 
    1672  * The $object_ids expects that the ids be separated by commas, if it is 
    1673  * a string. 
     1725 * The $object_ids expects that the ids be separated by commas, if it is a 
     1726 * string. 
    16741727 * 
    1675  * It should be noted that update_object_term_cache() is very time extensive. 
    1676  * It is advised that the function is not called very often or at least not 
    1677  * for a lot of terms that exist in a lot of taxonomies. The amount of time 
    1678  * increases for each term and it also increases for each taxonomy the term 
    1679  * belongs to. 
     1728 * It should be noted that update_object_term_cache() is very time extensive. It 
     1729 * is advised that the function is not called very often or at least not for a 
     1730 * lot of terms that exist in a lot of taxonomies. The amount of time increases 
     1731 * for each term and it also increases for each taxonomy the term belongs to. 
    16801732 * 
    16811733 * @package WordPress 
    16821734 * @subpackage Taxonomy 
     
    17341786        } 
    17351787} 
    17361788 
     1789 
    17371790/** 
    1738  * update_term_cache() - Updates Terms to Taxonomy in cache. 
     1791 * Updates Terms to Taxonomy in cache. 
    17391792 * 
    17401793 * @package WordPress 
    17411794 * @subpackage Taxonomy 
     
    17581811// Private 
    17591812// 
    17601813 
     1814 
    17611815/** 
    1762  * _get_term_hierarchy() - Retrieves children of taxonomy 
     1816 * Retrieves children of taxonomy. 
    17631817 * 
    17641818 * @package WordPress 
    17651819 * @subpackage Taxonomy 
    17661820 * @access private 
    17671821 * @since 2.3 
    17681822 * 
    1769  * @uses update_option() Stores all of the children in "$taxonomy_children" option. 
    1770  *      That is the name of the taxonomy, immediately followed by '_children'. 
     1823 * @uses update_option() Stores all of the children in "$taxonomy_children" 
     1824 *       option. That is the name of the taxonomy, immediately followed by '_children'. 
    17711825 * 
    17721826 * @param string $taxonomy Taxonomy Name 
    17731827 * @return array Empty if $taxonomy isn't hierarachical or returns children. 
     
    17901844        return $children; 
    17911845} 
    17921846 
     1847 
    17931848/** 
    1794  * _get_term_children() - Get array of child terms 
     1849 * Get array of child terms. 
    17951850 * 
    1796  * If $terms is an array of objects, then objects will returned from the function. 
    1797  * If $terms is an array of IDs, then an array of ids of children will be returned. 
     1851 * If $terms is an array of objects, then objects will returned from the 
     1852 * function. If $terms is an array of IDs, then an array of ids of children will 
     1853 * be returned. 
    17981854 * 
    17991855 * @package WordPress 
    18001856 * @subpackage Taxonomy 
     
    18461902        return $term_list; 
    18471903} 
    18481904 
     1905 
    18491906/** 
    1850  * _pad_term_counts() - Add count of children to parent count 
     1907 * Add count of children to parent count. 
    18511908 * 
    1852  * Recalculates term counts by including items from child terms. 
    1853  * Assumes all relevant children are already in the $terms argument 
     1909 * Recalculates term counts by including items from child terms. Assumes all 
     1910 * relevant children are already in the $terms argument. 
    18541911 * 
    18551912 * @package WordPress 
    18561913 * @subpackage Taxonomy 
     
    19101967// 
    19111968 
    19121969/** 
    1913  * _update_post_term_count() - Will update term count based on posts 
     1970 * Will update term count based on posts. 
    19141971 * 
    1915  * Private function for the default callback for post_tag and category taxonomies. 
     1972 * Private function for the default callback for post_tag and category 
     1973 * taxonomies. 
    19161974 * 
    19171975 * @package WordPress 
    19181976 * @subpackage Taxonomy 
     
    19311989        } 
    19321990} 
    19331991 
     1992 
    19341993/** 
    1935  * get_term_link() - Generates a permalink for a taxonomy term archive 
     1994 * Generates a permalink for a taxonomy term archive. 
    19361995 * 
     1996 * @since 2.6 
     1997 * 
    19371998 * @param object|int|string $term 
    19381999 * @param string $taxonomy 
    19392000 * @return string HTML link to taxonomy term archive 
     
    19752036        return apply_filters('term_link', $termlink, $term, $taxonomy); 
    19762037} 
    19772038 
     2039/** 
     2040 * Display the taxonomies of a post with available options. 
     2041 * 
     2042 * This function can be used within the loop to display the taxonomies for a 
     2043 * post without specifying the Post ID. You can also use it outside the Loop to 
     2044 * display the taxonomies for a specific post. 
     2045 * 
     2046 * The available defaults are: 
     2047 * 'post' : default is 0. The post ID to get taxonomies of. 
     2048 * 'before' : default is empty string. Display before taxonomies list. 
     2049 * 'sep' : default is empty string. Separate every taxonomy with value in this. 
     2050 * 'after' : default is empty string. Display this after the taxonomies list. 
     2051 * 
     2052 * @since 2.6 
     2053 * @uses get_the_taxonomies() 
     2054 * 
     2055 * @param array $args Override the defaults. 
     2056 */ 
    19782057function the_taxonomies($args = array()) { 
    19792058        $defaults = array( 
    19802059                'post' => 0, 
     
    19892068        echo $before . join($sep, get_the_taxonomies($post)) . $after; 
    19902069} 
    19912070 
     2071/** 
     2072 * Retrieve all taxonomies associated with a post. 
     2073 * 
     2074 * This function can be used within the loop. It will also return an array of 
     2075 * the taxonomies with links to the taxonomy and name. 
     2076 * 
     2077 * @since 2.6 
     2078 * 
     2079 * @param int $post Optional. Post ID or will use Global Post ID (in loop). 
     2080 * @return array 
     2081 */ 
    19922082function get_the_taxonomies($post = 0) { 
    19932083        if ( is_int($post) ) 
    19942084                $post =& get_post($post); 
     
    20262116        return $taxonomies; 
    20272117} 
    20282118 
     2119/** 
     2120 * Retrieve all taxonomies of a post with just the names. 
     2121 * 
     2122 * @since 2.6 
     2123 * @uses get_object_taxonomies() 
     2124 * 
     2125 * @param int $post Optional. Post ID 
     2126 * @return array 
     2127 */ 
    20292128function get_post_taxonomies($post = 0) { 
    20302129        $post =& get_post($post); 
    20312130 
    20322131        return get_object_taxonomies($post); 
    20332132} 
    20342133 
    2035 ?> 
     2134?> 
     2135 No newline at end of file