From efcc9adf346662a024653e6f225a58c809f0998d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 28 Nov 2012 23:19:03 +0000 Subject: [PATCH] In wp_list_bookmarks(), don't stomp the categorize argument. Fixes categorized display in the links widget. fixes #22216 git-svn-id: http://core.svn.wordpress.org/trunk@22910 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/bookmark-template.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 0673ffcea3..cb30b896a9 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -212,15 +212,16 @@ function wp_list_bookmarks($args = '') { $r = wp_parse_args( $args, $defaults ); extract( $r, EXTR_SKIP ); - if ( empty( $args['category'] ) ) - $categorize = 0; - $output = ''; if ( $categorize ) { - //Split the bookmarks into ul's for each category - $cats = get_terms('link_category', array('name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0)); + $cats = get_terms( 'link_category', array( 'name__like' => $category_name, 'include' => $category, 'exclude' => $exclude_category, 'orderby' => $category_orderby, 'order' => $category_order, 'hierarchical' => 0 ) ); + if ( empty( $cats ) ) + $categorize = false; + } + if ( $categorize ) { + // Split the bookmarks into ul's for each category foreach ( (array) $cats as $cat ) { $params = array_merge($r, array('category'=>$cat->term_id)); $bookmarks = get_bookmarks($params);