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.
Built from https://develop.svn.wordpress.org/trunk@27118


git-svn-id: http://core.svn.wordpress.org/trunk@26985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2014-02-07 17:17:13 +00:00
parent ab9e603c00
commit 31e9d97412
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 ] );
}
}