WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.7/wp-includes/category-template.php

    r10159 r10317  
    398398        if ( $show_option_all ) {
    399399            $show_option_all = apply_filters( 'list_cats', $show_option_all );
    400             $output .= "\t<option value='0'>$show_option_all</option>\n";
     400            $selected = ( '0' === strval($r['selected']) ) ? " selected='selected'" : '';
     401            $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
    401402        }
    402403
    403404        if ( $show_option_none ) {
    404405            $show_option_none = apply_filters( 'list_cats', $show_option_none );
    405             $output .= "\t<option value='-1'>$show_option_none</option>\n";
     406            $selected = ( '-1' === strval($r['selected']) ) ? " selected='selected'" : '';
     407            $output .= "\t<option value='-1'$selected>$show_option_none</option>\n";
    406408        }
    407409
     
    444446 *     'child_of' (int) default is 0 - See {@link get_categories()}.
    445447 *     'exclude' (string) - See {@link get_categories()}.
     448 *     'exclude_tree' (string) - See {@link get_categories()}.
    446449 *     'echo' (bool|int) default is 1 - Whether to display or retrieve content.
    447450 *     'current_category' (int) - See {@link get_categories()}.
     
    462465        'hide_empty' => 1, 'use_desc_for_title' => 1,
    463466        'child_of' => 0, 'feed' => '', 'feed_type' => '',
    464         'feed_image' => '', 'exclude' => '', 'current_category' => 0,
     467        'feed_image' => '', 'exclude' => '', 'exclude_tree' => '', 'current_category' => 0,
    465468        'hierarchical' => true, 'title_li' => __( 'Categories' ),
    466469        'echo' => 1, 'depth' => 0
     
    475478    if ( isset( $r['show_date'] ) ) {
    476479        $r['include_last_update_time'] = $r['show_date'];
     480    }
     481
     482    if ( true == $r['hierarchical'] ) {
     483        $r['exclude_tree'] = $r['exclude'];
     484        $r['exclude'] = '';
    477485    }
    478486
     
    537545 * be to return the top 45 tags in the tag cloud list.
    538546 *
    539 * The 'topic_count_text_callback' argument is a function, which, given the count
     547 * The 'topic_count_text_callback' argument is a function, which, given the count
    540548 * of the posts  with that tag, returns a text for the tooltip of the tag link.
    541  * @see default_topic_count_text
    542549 *
    543550 * The 'exclude' and 'include' arguments are used for the {@link get_tags()}
     
    614621 * The 'topic_count_text_callback' argument is a function, which given the count
    615622 * of the posts  with that tag returns a text for the tooltip of the tag link.
    616  * @see default_topic_count_text
    617  *
    618623 *
    619624 * @todo Complete functionality.
     
    650655        uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
    651656    else
    652         uasort( $tags, create_function('$a, $b', 'return ($a->count < $b->count);') );
     657        uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
    653658
    654659    if ( 'DESC' == $order )
     
    721726 */
    722727function walk_category_tree() {
    723     $walker = new Walker_Category;
    724728    $args = func_get_args();
     729    // the user's options are the third parameter
     730    if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
     731        $walker = new Walker_Category;
     732    else
     733        $walker = $args[2]['walker'];
     734
    725735    return call_user_func_array(array( &$walker, 'walk' ), $args );
    726736}
     
    734744 */
    735745function walk_category_dropdown_tree() {
    736     $walker = new Walker_CategoryDropdown;
    737746    $args = func_get_args();
     747    // the user's options are the third parameter
     748    if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
     749        $walker = new Walker_CategoryDropdown;
     750    else
     751        $walker = $args[2]['walker'];
     752
    738753    return call_user_func_array(array( &$walker, 'walk' ), $args );
    739754}
Note: See TracChangeset for help on using the changeset viewer.