Make WordPress Core

Changeset 28536


Ignore:
Timestamp:
05/22/2014 09:24:33 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Twenty Fourteen: Bail early from Featured_Content::hide_featured_term() if term objects are unavailable.

fixes #28072.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/inc/featured-content.php

    r27595 r28536  
    107107    public static function wp_loaded() {
    108108        if ( self::get_setting( 'hide-tag' ) ) {
    109             add_filter( 'get_terms',     array( __CLASS__, 'hide_featured_term'     ), 10, 2 );
     109            add_filter( 'get_terms',     array( __CLASS__, 'hide_featured_term'     ), 10, 3 );
    110110            add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 );
    111111        }
     
    313313     * @uses Featured_Content::get_setting()
    314314     */
    315     public static function hide_featured_term( $terms, $taxonomies ) {
     315    public static function hide_featured_term( $terms, $taxonomies, $args ) {
    316316
    317317        // This filter is only appropriate on the front-end.
     
    327327        // Bail if no terms were returned.
    328328        if ( empty( $terms ) ) {
     329            return $terms;
     330        }
     331
     332        // Bail if term objects are unavailable.
     333        if ( 'all' != $args['fields'] ) {
    329334            return $terms;
    330335        }
Note: See TracChangeset for help on using the changeset viewer.