Ticket #4742: taxonomy.r6291.phpdoc.patch
File taxonomy.r6291.phpdoc.patch, 12.1 KB (added by , 18 years ago) |
---|
-
taxonomy.php
235 235 * name as parameters. Both hooks are expected to return a Term object. 236 236 * 237 237 * 'get_term' hook - Takes two parameters the term Object and the taxonomy name. Must return 238 * term object. Used in @seeget_term() as a catch-all filter for every $term.238 * term object. Used in get_term() as a catch-all filter for every $term. 239 239 * 240 240 * 'get_$taxonomy' hook - Takes two parameters the term Object and the taxonomy name. Must return 241 241 * term object. $taxonomy will be the taxonomy name, so for example, if 'category', it would be … … 246 246 * @since 2.3 247 247 * 248 248 * @uses $wpdb 249 * @uses sanitize_term() Cleanses the term based on $filter context before returning. 250 * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param. 249 251 * 250 252 * @param int|object $term If integer, will get from database. If object will apply filters and return $term. 251 253 * @param string $taxonomy Taxonomy name that $term is part of. 252 254 * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N 253 * @param string $filter {@internal Missing Description}}255 * @param string $filter Optional, default is raw or no WordPress defined filter will applied. 254 256 * @return mixed|null|WP_Error Term Row from database. Will return null if $term is empty. If taxonomy does not 255 257 * exist then WP_Error will be returned. 256 258 */ … … 305 307 * @since 2.3 306 308 * 307 309 * @uses $wpdb 310 * @uses sanitize_term() Cleanses the term based on $filter context before returning. 311 * @see sanitize_term_field() The $context param lists the available values for get_term_by() $filter param. 308 312 * 309 313 * @param string $field Either 'slug', 'name', or 'id' 310 314 * @param string|int $value Search for this term value 311 315 * @param string $taxonomy Taxonomy Name 312 316 * @param string $output Constant OBJECT, ARRAY_A, or ARRAY_N 313 * @param string $filter {@internal Missing Description}}317 * @param string $filter Optional, default is raw or no WordPress defined filter will applied. 314 318 * @return mixed Term Row from database. Will return false if $taxonomy does not exist or $term was not found. 315 319 */ 316 320 function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw') { … … 394 398 * get_term_field() - Get sanitized Term field 395 399 * 396 400 * Does checks for $term, based on the $taxonomy. The function is for 397 * contextual reasons and for simplicity of usage. @see sanitize_term_field() for401 * contextual reasons and for simplicity of usage. See sanitize_term_field() for 398 402 * more information. 399 403 * 400 404 * @package WordPress … … 406 410 * @param string $field Term field to fetch 407 411 * @param int $term Term ID 408 412 * @param string $taxonomy Taxonomy Name 409 * @param string $context {@internal Missing Description}}413 * @param string $context Optional, default is display. Look at sanitize_term_field() for available options. 410 414 * @return mixed Will return an empty string if $term is not an object or if $field is not set in $term. 411 415 */ 412 416 function get_term_field( $field, $term, $taxonomy, $context = 'display' ) { … … 427 431 /** 428 432 * get_term_to_edit() - Sanitizes Term for editing 429 433 * 430 * Return value is @seesanitize_term() and usage is for sanitizing the term434 * Return value is sanitize_term() and usage is for sanitizing the term 431 435 * for editing. Function is for contextual and simplicity. 432 436 * 433 437 * @package WordPress … … 713 717 /** 714 718 * sanitize_term() - Sanitize Term all fields 715 719 * 716 * Relys on @seesanitize_term_field() to sanitize the term. The difference720 * Relys on sanitize_term_field() to sanitize the term. The difference 717 721 * is that this function will sanitize <strong>all</strong> fields. The context 718 * is based on @seesanitize_term_field().722 * is based on sanitize_term_field(). 719 723 * 720 724 * The $term is expected to be either an array or an object. 721 725 * … … 748 752 } 749 753 750 754 /** 751 * sanitize_term_field() - {@internal Missing Short Description}}755 * sanitize_term_field() - Cleanse the field value in the term based on the context 752 756 * 753 * {@internal Missing Long Description}} 757 * Passing a term field value through the function should be assumed to have cleansed 758 * the value for whatever context the term field is going to be used. 754 759 * 760 * If no context or an unsupported context is given, then default filters will be applied. 761 * 762 * There are enough filters for each context to support a custom filtering without creating 763 * your own filter function. Simply create a function that hooks into the filter you need. 764 * 755 765 * @package WordPress 756 766 * @subpackage Taxonomy 757 767 * @since 2.3 … … 834 844 } 835 845 836 846 /** 837 * wp_delete_object_term_relationships() - {@internal Missing Short Description}}847 * wp_delete_object_term_relationships() - Will unlink the term from the taxonomy 838 848 * 839 * {@internal Missing Long Description}} 849 * Will remove the term's relationship to the taxonomy, not the term or taxonomy itself. 850 * The term and taxonomy will still exist. Will require the term's object ID to perform 851 * the operation. 840 852 * 841 853 * @package WordPress 842 854 * @subpackage Taxonomy … … 865 877 /** 866 878 * wp_delete_term() - Removes a term from the database. 867 879 * 868 * {@internal Missing Long Description}} 880 * If the term is a parent of other terms, then the children will be updated 881 * to that term's parent. 869 882 * 883 * The $args 'default' will only override the terms found, if there is only one 884 * term found. Any other and the found terms are used. 885 * 870 886 * @package WordPress 871 887 * @subpackage Taxonomy 872 888 * @since 2.3 889 * 873 890 * @uses $wpdb 891 * @uses do_action() Calls both 'delete_term' and 'delete_$taxonomy' action hooks, 892 * passing term object, term id. 'delete_term' gets an additional parameter with 893 * the $taxonomy parameter. 874 894 * 875 895 * @param int $term Term ID 876 896 * @param string $taxonomy Taxonomy Name 877 * @param array|string $args Change Default878 * @return bool Returns false if not term; true if completes delete action.897 * @param array|string $args Optional. Change 'default' term id and override found term ids. 898 * @return bool|WP_Error Returns false if not term; true if completes delete action. 879 899 */ 880 900 function wp_delete_term( $term, $taxonomy, $args = array() ) { 881 901 global $wpdb; … … 933 953 } 934 954 935 955 /** 936 * wp_get_object_terms() - Ret urns the terms associated with the given object(s), in the supplied taxonomies.956 * wp_get_object_terms() - Retrieves the terms associated with the given object(s), in the supplied taxonomies. 937 957 * 938 958 * {@internal Missing Long Description}} 939 959 * … … 942 962 * @since 2.3 943 963 * @uses $wpdb 944 964 * 945 * @param int|array $object_id The id of the object(s) )to retrieve.965 * @param int|array $object_id The id of the object(s) to retrieve. 946 966 * @param string|array $taxonomies The taxonomies to retrieve terms from. 947 967 * @param array|string $args Change what is returned 948 968 * @return array|WP_Error The requested term data or empty array if no terms found. WP_Error if $taxonomy does not exist. … … 1088 1108 } 1089 1109 1090 1110 /** 1091 * wp_set_object_terms() - {@internal Missing Short Description}}1111 * wp_set_object_terms() - Create Term and Taxonomy Relationships 1092 1112 * 1093 * Relates an object (post, link etc) to a term and taxonomy type. 1094 * relationship if it doesn't already exist. 1113 * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy 1114 * relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug). 1095 1115 * 1116 * A relationship means that the term is grouped in or belongs to the taxonomy. A term has no 1117 * meaning until it is given context by defining which taxonomy it exists under. 1118 * 1096 1119 * @package WordPress 1097 1120 * @subpackage Taxonomy 1098 1121 * @since 2.3 … … 1206 1229 } 1207 1230 1208 1231 /** 1209 * wp_update_term() - {@internal Missing Short Description}}1232 * wp_update_term() - Update term based on arguments provided 1210 1233 * 1211 * {@internal Missing Long Description}} 1234 * The $args will indiscriminately override all values with the same field name. Care 1235 * must be taken to not override important information need to update or update will 1236 * fail (or perhaps create a new term, neither would be acceptable). 1212 1237 * 1238 * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not defined 1239 * in $args already. 1240 * 1241 * 'alias_of' will create a term group, if it doesn't already exist, and update it for 1242 * the $term. 1243 * 1244 * If the 'slug' argument in $args is missing, then the 'name' in $args will be used. 1245 * It should also be noted that if you set 'slug' and it isn't unique then a WP_Error 1246 * will be passed back. If you don't pass any slug, then a unique one will be created 1247 * for you. 1248 * 1249 * For what can be overrode in $args, check the term scheme can contain and stay away 1250 * from the term keys. 1251 * 1213 1252 * @package WordPress 1214 1253 * @subpackage Taxonomy 1215 1254 * @since 2.3 1255 * 1216 1256 * @uses $wpdb 1257 * @uses do_action() Will call both 'edit_term' and 'edit_$taxonomy' twice. 1258 * @uses apply_filters() Will call the 'term_id_filter' filter and pass the term id and 1259 * taxonomy id. 1217 1260 * 1218 1261 * @param int $term The ID of the term 1219 1262 * @param string $taxonomy The context in which to relate the term to the object. 1220 * @param array|string $args Overwrite defaults1221 * @return array Returns Term ID and Taxonomy Term ID1263 * @param array|string $args Overwrite term field values 1264 * @return array|WP_Error Returns Term ID and Taxonomy Term ID 1222 1265 */ 1223 1266 function wp_update_term( $term, $taxonomy, $args = array() ) { 1224 1267 global $wpdb; … … 1345 1388 // 1346 1389 1347 1390 /** 1348 * clean_object_term_cache() - {@internal Missing Short Description}}1391 * clean_object_term_cache() - Removes the taxonomy relationship to terms from the cache. 1349 1392 * 1350 * {@internal Missing Long Description}} 1393 * Will remove the entire taxonomy relationship containing term $object_id. The term IDs 1394 * have to exist within the taxonomy $object_type for the deletion to take place. 1351 1395 * 1352 1396 * @package WordPress 1353 1397 * @subpackage Taxonomy 1354 1398 * @since 2.3 1355 1399 * 1356 1400 * @see get_object_taxonomies() for more on $object_type 1401 * @uses do_action() Will call action hook named, 'clean_object_term_cache' after completion. 1402 * Passes, function params in same order. 1357 1403 * 1358 * @param int|array $object_ids {@internal Missing Description}}1359 * @param string $object_type {@internal Missing Description}}1404 * @param int|array $object_ids Single or list of term object ID(s) 1405 * @param string $object_type The taxonomy object type 1360 1406 */ 1361 1407 function clean_object_term_cache($object_ids, $object_type) { 1362 1408 if ( !is_array($object_ids) ) … … 1417 1463 } 1418 1464 1419 1465 /** 1420 * get_object_term_cache() - {@internal Missing Short Description}}1466 * get_object_term_cache() - Retrieves the taxonomy relationship to the term object id. 1421 1467 * 1422 * {@internal Missing Long Description}}1423 *1424 1468 * @package WordPress 1425 1469 * @subpackage Taxonomy 1426 1470 * @since 2.3 1427 1471 * 1428 * @param int|array $ids {@internal Missing Description}} 1429 * @param string $taxonomy {@internal Missing Description}} 1472 * @uses wp_cache_get() Retrieves taxonomy relationship from cache 1473 * 1474 * @param int|array $id Term object ID 1475 * @param string $taxonomy Taxonomy Name 1430 1476 * @return bool|array Empty array if $terms found, but not $taxonomy. False if nothing is in cache for $taxonomy and $id. 1431 1477 */ 1432 1478 function &get_object_term_cache($id, $taxonomy) { … … 1434 1480 } 1435 1481 1436 1482 /** 1437 * get_object_term_cache() - {@internal Missing Short Description}}1483 * update_object_term_cache() - {@internal Missing Short Description}} 1438 1484 * 1439 1485 * {@internal Missing Long Description}} 1440 1486 * … … 1523 1569 /** 1524 1570 * _get_term_hierarchy() - Retrieves children of taxonomy 1525 1571 * 1526 * {@internal Missing Long Description}}1527 *1528 1572 * @package WordPress 1529 1573 * @subpackage Taxonomy 1530 1574 * @access private 1531 1575 * @since 2.3 1532 1576 * 1533 * @param string $taxonomy {@internal Missing Description}} 1577 * @uses update_option() Stores all of the children in "$taxonomy_children" option. 1578 * That is the name of the taxonomy, immediately followed by '_children'. 1579 * 1580 * @param string $taxonomy Taxonomy Name 1534 1581 * @return array Empty if $taxonomy isn't hierarachical or returns children. 1535 1582 */ 1536 1583 function _get_term_hierarchy($taxonomy) { … … 1691 1738 } 1692 1739 } 1693 1740 1694 ?> 1741 ?> 1742 No newline at end of file