]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/category-template.php
WordPress 3.3.2-scripts
[autoinstalls/wordpress.git] / wp-includes / category-template.php
index 39e68594bd2fb275dd9d063ba99711455460259a..2be9eed7934b096057b5940c48f958e920ead5d4 100644 (file)
@@ -464,11 +464,14 @@ function wp_list_categories( $args = '' ) {
                                $output .= $show_option_none;
                }
        } else {
-               if( !empty( $show_option_all ) )
+               if ( ! empty( $show_option_all ) ) {
+                       $posts_page = ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) ) ? get_permalink( get_option( 'page_for_posts' ) ) : home_url( '/' );
+                       $posts_page = esc_url( $posts_page );
                        if ( 'list' == $style )
-                               $output .= '<li><a href="' .  get_bloginfo( 'url' )  . '">' . $show_option_all . '</a></li>';
+                               $output .= "<li><a href='$posts_page'>$show_option_all</a></li>";
                        else
-                               $output .= '<a href="' .  get_bloginfo( 'url' )  . '">' . $show_option_all . '</a>';
+                               $output .= "<a href='$posts_page'>$show_option_all</a>";
+               }
 
                if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
                        $current_term_object = get_queried_object();
@@ -642,9 +645,9 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
                } else {
                        // SQL cannot save you; this is a second (potentially different) sort on a subset of data.
                        if ( 'name' == $orderby )
-                               uasort( $tags, create_function('$a, $b', 'return strnatcasecmp($a->name, $b->name);') );
+                               uasort( $tags, '_wp_object_name_sort_cb' );
                        else
-                               uasort( $tags, create_function('$a, $b', 'return ($a->count > $b->count);') );
+                               uasort( $tags, '_wp_object_count_sort_cb' );
 
                        if ( 'DESC' == $order )
                                $tags = array_reverse( $tags, true );
@@ -704,22 +707,22 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
 }
 
 /**
- * Callback for comparing tags based on name
+ * Callback for comparing objects based on name
  *
  * @since 3.1.0
  * @access private
  */
-function _wp_tag_cloud_name_sort_cb( $a, $b ) {
+function _wp_object_name_sort_cb( $a, $b ) {
        return strnatcasecmp( $a->name, $b->name );
 }
 
 /**
- * Callback for comparing tags based on count
+ * Callback for comparing objects based on count
  *
  * @since 3.1.0
  * @access private
  */
-function _wp_tag_cloud_count_sort_cb( $a, $b ) {
+function _wp_object_count_sort_cb( $a, $b ) {
        return ( $a->count > $b->count );
 }