The previous logic checked to see if the manual excerpt was empty before
generating one automatically. The problem was when checking for a
manual excerpt, it passed the data through the the_excerpt filter.
In cases where themes or plugins filtered the_excerpt, this caused
our empty check to assume there was a manual excerpt, therefore no
automatic excerpt was generated. An example of where this can
happen is with social sharing plugins that use the filter to add
sharing links/buttons.
This changes the logic so that it passes the data through
the_excerpt later, which avoids this issue.
Additional changes:
Only checks for excerpts when the block is configured to show them.
How to test
Check out master branch.
Configure the Post Grid block to show excerpts.
Be sure some posts have manual excerpts and some do not have them.
Note that excerpts should show as expected.
Add the following code to your site and test excerpts again:
The previous logic checked to see if the manual excerpt was empty before generating one automatically. The problem was when checking for a manual excerpt, it passed the data through the
the_excerpt
filter. In cases where themes or plugins filteredthe_excerpt
, this caused our empty check to assume there was a manual excerpt, therefore no automatic excerpt was generated. An example of where this can happen is with social sharing plugins that use the filter to add sharing links/buttons.This changes the logic so that it passes the data through
the_excerpt
later, which avoids this issue.Additional changes:
How to test
master
branch.Suggested changelog entry