Twenty Fourteen: make sure `featured` tag is hidden on front-end views as expected. Add a check for the tag name in case we're using default values and the default ID of `0` does not match the term id of the `featured` tag.

Props obenland, fixes #26732.

git-svn-id: https://develop.svn.wordpress.org/trunk@27118 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2014-02-07 17:16:53 +00:00
parent dfb4b73fbe
commit cb8654eade
1 changed files with 4 additions and 2 deletions

View File

@ -329,8 +329,9 @@ class Featured_Content {
return $terms;
}
$settings = self::get_setting();
foreach( $terms as $order => $term ) {
if ( self::get_setting( 'tag-id' ) == $term->term_id && 'post_tag' == $term->taxonomy ) {
if ( ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) && 'post_tag' === $term->taxonomy ) {
unset( $terms[ $order ] );
}
}
@ -372,8 +373,9 @@ class Featured_Content {
return $terms;
}
$settings = self::get_setting();
foreach( $terms as $order => $term ) {
if ( self::get_setting( 'tag-id' ) == $term->term_id ) {
if ( ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) && 'post_tag' === $term->taxonomy ) {
unset( $terms[ $term->term_id ] );
}
}