From 2323b855402fe40a8df88542e7ae5f1f3acf37c0 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 23 Apr 2009 05:39:33 +0000 Subject: [PATCH] Return empty list if requests bookmark category does not exist. Props Viper007Bond. fixes #7507 git-svn-id: https://develop.svn.wordpress.org/trunk@11064 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/bookmark.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index af3222a1a0..04dbf2cef8 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -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) ) {