From 45dbe2545f304946d4503cd21149b320dc837674 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Mon, 27 Apr 2015 21:23:41 +0100 Subject: [PATCH] Squash warnings --- includes/sites.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/includes/sites.php b/includes/sites.php index ab54466..e76a652 100644 --- a/includes/sites.php +++ b/includes/sites.php @@ -1,6 +1,6 @@ name; - return( html_entity_decode( $name ) ); + if ( $terms ) { + $first_term = array_slice( $terms, 0, 1 ); + $bare_term = array_shift( $first_term ); + $name = $bare_term->name; + return( html_entity_decode( $name ) ); + } else { + return null; + } }