WordPress.org

Make WordPress Core

Changeset 6282


Ignore:
Timestamp:
10/21/2007 05:18:24 PM (11 years ago)
Author:
ryan
Message:

taxonomy phpdoc updates from darkdragon. see #4742

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r6271 r6282  
    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();
     
    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>
    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
    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) {
     
    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
     
    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 ) {
     
    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 ) {
     
    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) {
     
    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.
    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
    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() ) {
     
    182176 * @package WordPress
    183177 * @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 *
    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() ) {
     
    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
     
    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.
    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 *
    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') {
     
    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);
     
    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  * 
    333  *
    334  * @package WordPress
    335  * @subpackage Taxonomy
    336  * @category Term
    337  *
    338  * @global object $wpdb Database Query
     302 *
     303 * @package WordPress
     304 * @subpackage Taxonomy
     305 * @since 2.3
     306 *
     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') {
     
    389356 *
    390357 * 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.
    394361 *
    395362 * @package WordPress
    396363 * @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 *
    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 ) {
     
    433400 * @package WordPress
    434401 * @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.
    436405 *
    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' ) {
     
    467433 * @package WordPress
    468434 * @subpackage Taxonomy
    469  * @category Term
     435 * @since 2.3
     436 *
     437 * @uses sanitize_term() Passes the return value on success
    470438 *
    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 ) {
     
    489454
    490455/**
    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.
    498497 *
    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 = '') {
     
    684680 * @package WordPress
    685681 * @subpackage Taxonomy
    686  * @category Term
    687  *
    688  * @global $wpdb Database Object
     682 * @since 2.3
     683 *
     684 * @uses $wpdb
     685 *
    689686 * @param int|string $term The term to check
    690687 * @param string $taxonomy The taxonomy name to use
     
    721718 * @package WordPress
    722719 * @subpackage Taxonomy
    723  * @category Term
     720 * @since 2.3
     721 *
     722 * @uses sanitize_term_field Used to sanitize all fields in a term
    724723 *
    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 */
     
    746745
    747746/**
    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 *
    757757 * @param string $field Term field to sanitize
    758758 * @param string $value Search for this term value
     
    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.
    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 *
    812813 * @param string $taxonomy Taxonomy name
    813814 * @param array|string $args Overwrite defaults
     
    830831
    831832/**
    832  * wp_delete_object_term_relationships() -
    833  *
    834  *
    835  *
    836  * @package WordPress
    837  * @subpackage Taxonomy
    838  * @category Term
    839  *
    840  * @global object $wpdb Database Object
    841  * @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
    842843 * @param string|array $taxonomy List of Taxonomy Names or single Taxonomy name.
    843844 */
     
    861862 * wp_delete_term() - Removes a term from the database.
    862863 *
    863  *
    864  *
    865  * @package WordPress
    866  * @subpackage Taxonomy
    867  * @category Term
    868  *
    869  * @global object $wpdb Database Object
     864 * {@internal Missing Long Description}}
     865 *
     866 * @package WordPress
     867 * @subpackage Taxonomy
     868 * @since 2.3
     869 * @uses $wpdb
     870 *
    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() ) {
     
    931932 * wp_get_object_terms() - Returns the terms associated with the given object(s), in the supplied taxonomies.
    932933 *
    933  *
    934  *
    935  * @package WordPress
    936  * @subpackage Taxonomy
    937  * @category Term
    938  *
    939  * @global $wpdb Database Object
    940  * @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.
    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()) {
     
    9991000 * wp_insert_term() - Adds a new term to the database. Optionally marks it as an alias of an existing term.
    10001001 *
    1001  *
    1002  *
    1003  * @package WordPress
    1004  * @subpackage Taxonomy
    1005  * @category Term
    1006  *
    1007  * @global $wpdb Database Object
     1002 * {@internal Missing Long Description}}
     1003 *
     1004 * @package WordPress
     1005 * @subpackage Taxonomy
     1006 * @since 2.3
     1007 * @uses $wpdb
     1008 *
    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() ) {
     
    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
     
    10911092 * @package WordPress
    10921093 * @subpackage Taxonomy
    1093  * @category Term
    1094  *
    1095  * @global $wpdb Database Object
     1094 * @since 2.3
     1095 * @uses $wpdb
     1096 *
    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) {
     
    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  *
    1162  * @package WordPress
    1163  * @subpackage Taxonomy
    1164  * @category Term
    1165  *
    1166  * @global $wpdb Database Object
     1161 * 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 *
    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
     
    12021203
    12031204/**
    1204  * wp_update_term() -
    1205  * 
    1206  *
    1207  *
    1208  * @package WordPress
    1209  * @subpackage Taxonomy
    1210  * @category Term
    1211  *
    1212  * @global $wpdb Database Object
     1205 * 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 *
    12131214 * @param int $term The ID of the term
    12141215 * @param string $taxonomy The context in which to relate the term to the object.
     
    13011302 * @package WordPress
    13021303 * @subpackage Taxonomy
    1303  * @category Term
    1304  *
    1305  * @global $wpdb Database Object
     1304 * @since 2.3
     1305 * @uses $wpdb
     1306 *
    13061307 * @param int|array $terms The ID of the terms
    13071308 * @param string $taxonomy The context of the term.
     
    13411342
    13421343/**
    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}}
    13561356 */
    13571357function clean_object_term_cache($object_ids, $object_type) {
     
    13661366
    13671367/**
    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}}
    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 = '') {
     
    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');
     
    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;
     
    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 ) {
     
    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) )
     
    14941542
    14951543/**
    1496  * @access private
    14971544 * _get_term_children() - Get array of child terms
    14981545 *
     
    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) {
     
    15481597
    15491598/**
    1550  * @access private
    15511599 * _pad_term_counts() - Add count of children to parent count
    15521600 *
     
    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) {
     
    16081660
    16091661/**
    1610  * @access private
    16111662 * _update_post_term_count() - Will update term count based on posts
    16121663 *
     
    16151666 * @package WordPress
    16161667 * @subpackage Taxonomy
    1617  * @category Callback
    1618  *
    1619  * @global $wpdb Database Object
     1668 * @access private
     1669 * @since 2.3
     1670 * @uses $wpdb
     1671 *
    16201672 * @param array $terms List of Term IDs
    16211673 */
Note: See TracChangeset for help on using the changeset viewer.