Return empty list if requests bookmark category does not exist. Props Viper007Bond. fixes #7507

git-svn-id: http://svn.automattic.com/wordpress/trunk@11064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-23 05:39:33 +00:00
parent 857a0563cf
commit 90d7c33579
1 changed files with 7 additions and 2 deletions

View File

@ -185,9 +185,14 @@ function get_bookmarks($args = '') {
if (!empty($exclusions))
$exclusions .= ')';
if ( ! empty($category_name) ) {
if ( $category = get_term_by('name', $category_name, 'link_category') )
if ( !empty($category_name) ) {
if ( $category = get_term_by('name', $category_name, 'link_category') ) {
$category = $category->term_id;
} else {
$cache[ $key ] = array();
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
return apply_filters( 'get_bookmarks', array(), $r );
}
}
if ( ! empty($search) ) {