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:
parent
857a0563cf
commit
90d7c33579
|
@ -185,9 +185,14 @@ function get_bookmarks($args = '') {
|
||||||
if (!empty($exclusions))
|
if (!empty($exclusions))
|
||||||
$exclusions .= ')';
|
$exclusions .= ')';
|
||||||
|
|
||||||
if ( ! empty($category_name) ) {
|
if ( !empty($category_name) ) {
|
||||||
if ( $category = get_term_by('name', $category_name, 'link_category') )
|
if ( $category = get_term_by('name', $category_name, 'link_category') ) {
|
||||||
$category = $category->term_id;
|
$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) ) {
|
if ( ! empty($search) ) {
|
||||||
|
|
Loading…
Reference in New Issue