mirror of
git://develop.git.wordpress.org/
synced 2025-02-27 10:02:43 +01:00
Check for WP_Error in get_the_category(). props batmoo. fixes #21155.
git-svn-id: https://develop.svn.wordpress.org/trunk@22412 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
49d5e725ce
commit
ba7fb93e4e
@ -73,7 +73,7 @@ function get_category_parents( $id, $link = false, $separator = '/', $nicename =
|
||||
*/
|
||||
function get_the_category( $id = false ) {
|
||||
$categories = get_the_terms( $id, 'category' );
|
||||
if ( ! $categories )
|
||||
if ( ! $categories || is_wp_error( $categories ) )
|
||||
$categories = array();
|
||||
|
||||
$categories = array_values( $categories );
|
||||
|
Loading…
x
Reference in New Issue
Block a user