Changeset 6726 for trunk/wp-includes/taxonomy.php
- Timestamp:
- 02/05/2008 06:47:27 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r6660 r6726 32 32 * @subpackage Taxonomy 33 33 * @since 2.3 34 * 34 * 35 35 * @uses $wp_taxonomies 36 36 * … … 81 81 * @subpackage Taxonomy 82 82 * @since 2.3 83 * 83 * 84 84 * @uses $wp_taxonomies 85 85 * … … 140 140 * @since 2.3 141 141 * @uses $wp_taxonomies Inserts new taxonomy object into the list 142 * 142 * 143 143 * @param string $taxonomy Name of taxonomy object 144 144 * @param string $object_type Name of the object type for the taxonomy object. … … 276 276 } 277 277 } 278 278 279 279 $_term = apply_filters('get_term', $_term, $taxonomy); 280 280 $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); … … 363 363 * 364 364 * Will return an empty array if $term does not exist in $taxonomy. 365 * 365 * 366 366 * @package WordPress 367 367 * @subpackage Taxonomy … … 397 397 /** 398 398 * get_term_field() - Get sanitized Term field 399 * 399 * 400 400 * Does checks for $term, based on the $taxonomy. The function is for 401 401 * contextual reasons and for simplicity of usage. See sanitize_term_field() for … … 434 434 * Return value is sanitize_term() and usage is for sanitizing the term 435 435 * for editing. Function is for contextual and simplicity. 436 * 436 * 437 437 * @package WordPress 438 438 * @subpackage Taxonomy … … 630 630 if( $offset ) 631 631 $number = 'LIMIT ' . $offset . ',' . $number; 632 else 632 else 633 633 $number = 'LIMIT ' . $number; 634 634 635 635 } else 636 636 $number = ''; … … 810 810 if ( 'slug' == $field ) 811 811 $value = apply_filters('pre_category_nicename', $value); 812 812 813 813 } else if ( 'rss' == $context ) { 814 814 $value = apply_filters("term_${field}_rss", $value, $taxonomy); … … 1033 1033 else if ( 'ids' == $fields ) 1034 1034 $select_this = 't.term_id'; 1035 else if ( 'names' == $fields ) 1035 else if ( 'names' == $fields ) 1036 1036 $select_this = 't.name'; 1037 1037 else if ( 'all_with_object_id' == $fields ) … … 1176 1176 /** 1177 1177 * wp_set_object_terms() - Create Term and Taxonomy Relationships 1178 * 1178 * 1179 1179 * Relates an object (post, link etc) to a term and taxonomy type. Creates the term and taxonomy 1180 1180 * relationship if it doesn't already exist. Creates a term if it doesn't exist (using the slug). … … 1214 1214 if ( !strlen(trim($term)) ) 1215 1215 continue; 1216 1216 1217 1217 if ( !$id = is_term($term, $taxonomy) ) 1218 1218 $id = wp_insert_term($term, $taxonomy); … … 1244 1244 /** 1245 1245 * wp_unique_term_slug() - Will make slug unique, if it isn't already 1246 * 1246 * 1247 1247 * The $slug has to be unique global to every taxonomy, meaning that one taxonomy 1248 1248 * term can't have a matching slug with another taxonomy term. Each slug has to be … … 1254 1254 * If that still doesn't return an unique slug, then it try to append a number until 1255 1255 * it finds a number that is truely unique. 1256 * 1256 * 1257 1257 * The only purpose for $term is for appending a parent, if one exists. 1258 1258 * … … 1421 1421 function wp_defer_term_counting($defer=NULL) { 1422 1422 static $_defer = false; 1423 1423 1424 1424 if ( is_bool($defer) ) { 1425 1425 $_defer = $defer; … … 1428 1428 wp_update_term_count( NULL, NULL, true ); 1429 1429 } 1430 1430 1431 1431 return $_defer; 1432 1432 } … … 1434 1434 /** 1435 1435 * wp_update_term_count() - Updates the amount of terms in taxonomy 1436 * 1436 * 1437 1437 * If there is a taxonomy callback applyed, then it will be called for updating the count. 1438 1438 * … … 1471 1471 return true; 1472 1472 } 1473 1473 1474 1474 return wp_update_term_count_now( $terms, $taxonomy ); 1475 1475 } … … 1601 1601 * 1602 1602 * It should be noted that update_object_term_cache() is very time extensive. 1603 * It is advised that the function is not called very often or at least not 1603 * It is advised that the function is not called very often or at least not 1604 1604 * for a lot of terms that exist in a lot of taxonomies. The amount of time 1605 1605 * increases for each term and it also increases for each taxonomy the term … … 1613 1613 * @param string|array $object_ids Single or list of term object ID(s) 1614 1614 * @param string $object_type The taxonomy object type 1615 * @return null|bool Null value is given with empty $object_ids. False if 1615 * @return null|bool Null value is given with empty $object_ids. False if 1616 1616 */ 1617 1617 function update_object_term_cache($object_ids, $object_type) { … … 1720 1720 /** 1721 1721 * _get_term_children() - Get array of child terms 1722 * 1722 * 1723 1723 * If $terms is an array of objects, then objects will returned from the function. 1724 1724 * If $terms is an array of IDs, then an array of ids of children will be returned. … … 1776 1776 /** 1777 1777 * _pad_term_counts() - Add count of children to parent count 1778 * 1778 * 1779 1779 * Recalculates term counts by including items from child terms. 1780 1780 * Assumes all relevant children are already in the $terms argument … … 1827 1827 } 1828 1828 1829 // Transfer the touched cells 1829 // Transfer the touched cells 1830 1830 foreach ( (array) $term_items as $id => $items ) 1831 1831 if ( isset($terms_by_id[$id]) ) … … 1839 1839 /** 1840 1840 * _update_post_term_count() - Will update term count based on posts 1841 * 1841 * 1842 1842 * Private function for the default callback for post_tag and category taxonomies. 1843 1843 *
Note: See TracChangeset
for help on using the changeset viewer.