Ticket #8214: 8214.001.diff
File 8214.001.diff, 4.6 KB (added by , 15 years ago) |
---|
-
trunk/wp-includes/taxonomy.php
527 527 * 528 528 * hide_empty - Default is true. Will not return empty terms, which means 529 529 * terms whose count is 0 according to the given taxonomy. 530 * 530 * 531 531 * exclude - Default is an empty string. A comma- or space-delimited string 532 * of term ids to exclude from the return array. If 'include' is non-empty, 532 * of term ids to exclude from the return array. If 'include' is non-empty, 533 533 * 'exclude' is ignored. 534 534 * 535 535 * include - Default is an empty string. A comma- or space-delimited string 536 536 * of term ids to include in the return array. 537 * 537 * 538 538 * number - The maximum number of terms to return. Default is empty. 539 * 539 * 540 540 * offset - The number by which to offset the terms query. 541 541 * 542 * fields - Default is 'all', which returns an array of term objects. 542 * fields - Default is 'all', which returns an array of term objects. 543 543 * If 'fields' is 'ids' or 'names', returns an array of 544 544 * integers or strings, respectively. 545 545 * 546 546 * slug - Returns terms whose "slug" matches this value. Default is empty string. 547 * 547 * 548 548 * hierarchical - Whether to include terms that have non-empty descendants 549 549 * (even if 'hide_empty' is set to true). 550 * 550 * 551 551 * search - Returned terms' names will contain the value of 'search', 552 552 * case-insensitive. Default is an empty string. 553 553 * … … 561 561 * returns terms regardless of ancestry or whether the terms are empty. 562 562 * 563 563 * The 'child_of' argument, when used, should be set to the integer of a term ID. Its default 564 * is 0. If set to a non-zero value, all returned terms will be descendants 565 * of that term according to the given taxonomy. Hence 'child_of' is set to 0 566 * if more than one taxonomy is passed in $taxonomies, because multiple taxonomies 564 * is 0. If set to a non-zero value, all returned terms will be descendants 565 * of that term according to the given taxonomy. Hence 'child_of' is set to 0 566 * if more than one taxonomy is passed in $taxonomies, because multiple taxonomies 567 567 * make term ancestry ambiguous. 568 568 * 569 569 * The 'parent' argument, when used, should be set to the integer of a term ID. Its default is 570 570 * the empty string '', which has a different meaning from the integer 0. 571 * If set to an integer value, all returned terms will have as an immediate 571 * If set to an integer value, all returned terms will have as an immediate 572 572 * ancestor the term whose ID is specified by that integer according to the given taxonomy. 573 573 * The 'parent' argument is different from 'child_of' in that a term X is considered a 'parent' 574 574 * of term Y only if term X is the father of term Y, not its grandfather or great-grandfather, etc. … … 605 605 'hide_empty' => true, 'exclude' => '', 'include' => '', 606 606 'number' => '', 'fields' => 'all', 'slug' => '', 'parent' => '', 607 607 'hierarchical' => true, 'child_of' => 0, 'get' => '', 'name__like' => '', 608 'pad_counts' => false, 'offset' => '', 'search' => ''); 608 'description__like'=>'', 'pad_counts' => false, 'offset' => '', 609 'search' => ''); 609 610 $args = wp_parse_args( $args, $defaults ); 610 611 $args['number'] = absint( $args['number'] ); 611 612 $args['offset'] = absint( $args['offset'] ); … … 707 708 if ( !empty($name__like) ) 708 709 $where .= " AND t.name LIKE '{$name__like}%'"; 709 710 711 if ( !empty($description__like) ) 712 $where .= " AND tt.description LIKE '{$description__like}%'"; 713 710 714 if ( '' != $parent ) { 711 715 $parent = (int) $parent; 712 716 $where .= " AND tt.parent = '$parent'"; … … 779 783 } 780 784 } 781 785 reset ( $terms ); 782 786 783 787 $_terms = array(); 784 788 if ( 'ids' == $fields ) { 785 789 while ( $term = array_shift($terms) ) … … 1945 1949 * @param int $term_id The ancestor term: all returned terms should be descendants of $term_id. 1946 1950 * @param array $terms The set of terms---either an array of term objects or term IDs---from which those that are descendants of $term_id will be chosen. 1947 1951 * @param string $taxonomy The taxonomy which determines the hierarchy of the terms. 1948 * @return array The subset of $terms that are descendants of $term_id. 1952 * @return array The subset of $terms that are descendants of $term_id. 1949 1953 */ 1950 1954 function &_get_term_children($term_id, $terms, $taxonomy) { 1951 1955 $empty_array = array(); … … 2029 2033 $id = $term_ids[$row->term_taxonomy_id]; 2030 2034 $term_items[$id][$row->object_id] = isset($term_items[$id][$row->object_id]) ? ++$term_items[$id][$row->object_id] : 1; 2031 2035 } 2032 2036 2033 2037 // Touch every ancestor's lookup row for each post in each term 2034 2038 foreach ( $term_ids as $term_id ) { 2035 2039 $child = $term_id;