Changeset 13086 for trunk/wp-admin/includes/template.php
- Timestamp:
- 02/13/2010 05:40:47 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r13081 r13086 483 483 * @return unknown 484 484 */ 485 function _tag_row( $tag, $level, $class = '', $taxonomy = 'post_tag' ) { 485 function _tag_row( $tag, $level, $taxonomy = 'post_tag' ) { 486 static $row_class = ''; 487 $row_class = ($row_class == '' ? ' class="alternate"' : ''); 488 486 489 $count = number_format_i18n( $tag->count ); 487 490 if ( 'post_tag' == $taxonomy ) … … 497 500 498 501 $pad = str_repeat( '— ', max(0, $level) ); 499 $name = apply_filters( 'term_name', $pad . ' ' . $tag->name );502 $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag ); 500 503 $qe_data = get_term($tag->term_id, $taxonomy, object, 'edit'); 501 504 $edit_link = "edit-tags.php?action=edit&taxonomy=$taxonomy&tag_ID=$tag->term_id"; 502 505 503 506 $out = ''; 504 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; 507 $out .= '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>'; 508 505 509 506 510 $columns = get_column_headers('edit-tags'); … … 608 612 $children = _get_term_hierarchy($taxonomy); 609 613 610 // Some funky recursion to get the job done is contained within, Skip it for non-hierarchical taxonomies for performance sake614 // Some funky recursion to get the job done(Paging & parents mainly) is contained within, Skip it for non-hierarchical taxonomies for performance sake 611 615 $out .= _term_rows($taxonomy, $terms, $children, $page, $pagesize, $count); 612 616 } else { 613 617 $terms = get_terms( $taxonomy, $args ); 614 618 foreach( $terms as $term ) 615 $out .= _tag_row( $term, 0, ++$count % 2 ? ' class="alternate"' : '',$taxonomy );619 $out .= _tag_row( $term, 0, $taxonomy ); 616 620 } 617 621 … … 649 653 650 654 $num_parents = count($my_parents); 651 $count -= $num_parents; // Do not include parents in the per-page count, This is due to paging issues with unknown numbers of rows.652 655 while ( $my_parent = array_pop($my_parents) ) { 653 $output .= "\t" . _tag_row( $my_parent, $level - $num_parents, ++$count % 2 ? ' class="alternate"' : '',$taxonomy );656 $output .= "\t" . _tag_row( $my_parent, $level - $num_parents, $taxonomy ); 654 657 $num_parents--; 655 658 } … … 657 660 658 661 if ( $count >= $start ) 659 $output .= "\t" . _tag_row( $term, $level, ++$count % 2 ? ' class="alternate"' : '',$taxonomy );660 else 661 662 $output .= "\t" . _tag_row( $term, $level, $taxonomy ); 663 664 ++$count; 662 665 663 666 unset($terms[$key]); 664 667 665 if ( isset($children[$term->term_id]) )668 if ( isset($children[$term->term_id]) && empty($_GET['s']) ) 666 669 $output .= _term_rows( $taxonomy, $terms, $children, $page, $per_page, $count, $term->term_id, $level + 1 ); 667 670 }
Note: See TracChangeset
for help on using the changeset viewer.