mirror of
git://develop.git.wordpress.org/
synced 2025-02-25 09:03:09 +01:00
Twenty Fourteen: Bail early from Featured_Content::hide_featured_term() if term objects are unavailable.
fixes #28072. git-svn-id: https://develop.svn.wordpress.org/trunk@28536 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
9966795165
commit
3bd4762f9b
@ -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 ) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user