$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();
} 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 );
}
/**
- * 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 );
}