[wp-trac] [WordPress Trac] #33629: Post excerpts have become WAY too long after updating to WP 4.3, please fix.
WordPress Trac
noreply at wordpress.org
Fri Sep 25 01:20:00 UTC 2015
#33629: Post excerpts have become WAY too long after updating to WP 4.3, please
fix.
-----------------------------+------------------------------
Reporter: MarineKingAizen | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 4.3
Severity: normal | Resolution:
Keywords: needs-testing | Focuses:
-----------------------------+------------------------------
Comment (by hughc):
Just to offer some feedback here, after this issue was reported to me by a
site owner.
Their theme (Elegant Theme's Glow) had a custom routine for truncating
posts, that took a character count as a parameter. This, in turn called
wp_trim_words(), passing the same character count, which, up until 4.3
returned what they expected, a string trimmed to the desired character
length.
ie
{{{
$output = wp_trim_words( $input, $length, '' );
}}}
There is no explicit locale set on the site, but under 4.3, the same call
to wp_trim_words() returns words, not characters. Modifying the theme
function to use wp_html_excerpt() fixed the issue.
{{{
$output = wp_html_excerpt( $input, $length, '' )
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33629#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list