Skip to content

Commit

Permalink
Call remove_all_filter() on the the_excerpt hook to improve excer…
Browse files Browse the repository at this point in the history
…pt rendering
  • Loading branch information
aprea committed Jun 4, 2014
1 parent 4bedcbe commit 9dbe86a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion advanced-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Advanced Excerpt
Plugin URI: http://wordpress.org/plugins/advanced-excerpt/
Description: Control the appearance of WordPress post excerpts
Version: 4.2.2
Version: 4.2.3
Author: Delicious Brains
Author URI: http://deliciousbrains.com/
*/
Expand Down
1 change: 1 addition & 0 deletions class/advanced-excerpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function hook_content_filters() {

if ( 1 == $this->options['the_excerpt'] ) {
remove_all_filters( 'get_the_excerpt' );
remove_all_filters( 'the_excerpt' );
add_filter( 'get_the_excerpt', array( $this, 'filter' ) );
}

Expand Down
1 change: 1 addition & 0 deletions functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ function the_advanced_excerpt( $args = '', $get = false ) {
// Ensure our filter is hooked, regardless of the page type
if ( ! has_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter' ) ) ) {
remove_all_filters( 'get_the_excerpt' );
remove_all_filters( 'the_excerpt' );
add_filter( 'get_the_excerpt', array( $advanced_excerpt, 'filter' ) );
}

Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: excerpt, post, content, formatting
Requires at least: 3.2
Tested up to: 3.9
Stable tag: 4.2.2
Stable tag: 4.2.3
License: GPLv3

Control the appearance of WordPress post excerpts
Expand Down Expand Up @@ -96,6 +96,9 @@ However, you can [start The Loop manually](http://codex.wordpress.org/The_Loop#M

== Changelog ==

= 4.2.3 =
* Fix: Call `remove_all_filter()` on the `the_excerpt` hook to improve excerpt rendering

= 4.2.2 =
* Fix: The `the_advanced_excerpt()` function was not working on singular page types (pages / posts)

Expand Down

0 comments on commit 9dbe86a

Please sign in to comment.