Skip to content

Commit

Permalink
The "Remove all tags except the following" wasn't excluding tags as e…
Browse files Browse the repository at this point in the history
…xpected
  • Loading branch information
aprea committed Jun 4, 2014
1 parent 9dbe86a commit 93e8b1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions class/advanced-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ function filter( $text ) {

$original_post_content = $text;

// Determine allowed tags
if ( empty( $allowed_tags ) ) {
$allowed_tags = $this->options_all_tags;
$allowed_tags = array();
}

// the $exclude_tags args takes precedence over the $allowed_tags args (only if they're both defined)
if ( ! empty( $exclude_tags ) ) {
$allowed_tags = array_diff( $allowed_tags, $exclude_tags );
$allowed_tags = array_diff( $this->options_all_tags, $exclude_tags );
}

// Strip HTML if $allowed_tags_option is set to 'remove_all_tags_except'
Expand All @@ -260,6 +260,7 @@ function filter( $text ) {
} else {
$tag_string = '';
}

$text = strip_tags( $text, $tag_string );
}

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ However, you can [start The Loop manually](http://codex.wordpress.org/The_Loop#M
== Changelog ==

= 4.2.3 =
* Fix: The "Remove all tags except the following" wasn't excluding tags as expected
* Fix: Call `remove_all_filter()` on the `the_excerpt` hook to improve excerpt rendering

= 4.2.2 =
Expand Down

0 comments on commit 93e8b1d

Please sign in to comment.