diff --git a/wp-content/themes/twentyfourteen/inc/featured-content.php b/wp-content/themes/twentyfourteen/inc/featured-content.php index 3f9dc411a4..f9789d8dec 100644 --- a/wp-content/themes/twentyfourteen/inc/featured-content.php +++ b/wp-content/themes/twentyfourteen/inc/featured-content.php @@ -106,7 +106,7 @@ class Featured_Content { */ public static function wp_loaded() { if ( self::get_setting( 'hide-tag' ) ) { - add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 2 ); + add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 ); add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 ); } } @@ -312,7 +312,7 @@ class Featured_Content { * * @uses Featured_Content::get_setting() */ - public static function hide_featured_term( $terms, $taxonomies ) { + public static function hide_featured_term( $terms, $taxonomies, $args ) { // This filter is only appropriate on the front-end. if ( is_admin() ) { @@ -329,6 +329,11 @@ class Featured_Content { return $terms; } + // Bail if term objects are unavailable. + if ( 'all' != $args['fields'] ) { + return $terms; + } + $settings = self::get_setting(); foreach( $terms as $order => $term ) { if ( ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) && 'post_tag' === $term->taxonomy ) {