Make WordPress Core


Ignore:
Timestamp:
05/24/2009 11:47:49 PM (17 years ago)
Author:
ryan
Message:

Trim tailing whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r11445 r11450  
    2222 */
    2323function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
    24        
     24
    2525        $count = 0;
    26        
     26
    2727        if ( empty($categories) ) {
    28                
     28
    2929                $args = array('hide_empty' => 0);
    3030                if ( !empty($_GET['s']) )
    3131                        $args['search'] = $_GET['s'];
    32                        
    33                 $categories = get_categories( $args ); 
    34                
     32
     33                $categories = get_categories( $args );
     34
    3535                if ( empty($categories) )
    3636                        return false;
    3737        }
    3838
    39         $children = _get_term_hierarchy('category'); 
    40        
    41         _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count ); 
    42        
     39        $children = _get_term_hierarchy('category');
     40
     41        _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
     42
    4343}
    4444
    … …  
    5656 * @return unknown
    5757 */
    58 function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) { 
    59        
     58function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
     59
    6060        $start = ($page - 1) * $per_page;
    6161        $end = $start + $per_page;
    6262        ob_start();
    63        
     63
    6464        foreach ( $categories as $key => $category ) {
    6565                if ( $count >= $end )
    6666                        break;
    67                        
     67
    6868                if ( $category->parent != $parent && empty($_GET['s']) )
    6969                        continue;
    … …  
    7171                // If the page starts in a subtree, print the parents.
    7272                if ( $count == $start && $category->parent > 0 ) {
    73                        
     73
    7474                        $my_parents = array();
    7575                        $p = $category->parent;
    … …  
    8181                                $p = $my_parent->parent;
    8282                        }
    83                        
     83
    8484                        $num_parents = count($my_parents);
    8585                        while( $my_parent = array_pop($my_parents) ) {
    … …  
    9292                        echo "\t" . _cat_row( $category, $level );
    9393
    94                 unset( $categories[ $key ] ); 
    95                
     94                unset( $categories[ $key ] );
     95
    9696                $count++;
    9797
    9898                if ( isset($children[$category->term_id]) )
    99                         _cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count ); 
     99                        _cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count );
    100100        }
    101101
    … …  
    518518        // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
    519519        $checked_categories = array();
    520         $keys = array_keys( $categories ); 
    521        
     520        $keys = array_keys( $categories );
     521
    522522        foreach( $keys as $k ) {
    523523                if ( in_array( $categories[$k]->term_id, $args['selected_cats'] ) ) {
    524524                        $checked_categories[] = $categories[$k];
    525525                        unset( $categories[$k] );
    526                 }       
     526                }
    527527        }
    528528
    … …  
    35993599                return '';
    36003600        }
    3601        
     3601
    36023602        $screen_layout_columns = get_user_option("screen_layout_$screen");
    36033603        $num = $columns[$screen];
Note: See TracChangeset for help on using the changeset viewer.