Opened 9 years ago
Last modified 6 years ago
#33629 new defect (bug)
Post excerpts have become WAY too long after updating to WP 4.3, please fix.
Reported by: | MarineKingAizen | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | Formatting | Keywords: | needs-testing |
Focuses: | Cc: |
Description
I believe this is a bug in the new WP release. After updating, all my websites are in chaos because the post excerpts have become way too long and most themes were not designed to handle it. I'm not the only one to notice this:
One user said "WP 4.3 seemed to have changed trunctation from characters to words."
Change History (11)
#2
@
9 years ago
@MarineKingAizen are you running WordPress with a non-english locale? If so, which one?
#3
follow-up:
↓ 6
@
9 years ago
One site mentioned in the support thread referenced above looks like it's using the zh_TW locale.
#4
@
9 years ago
My personal website is NOT a non-english locale. My clients aren't either and across different themes (including Magnificent by Elegant Themes, Divi by Elegant themes, varies themes by Ink Themes, etc) all are experiencing the same problem with post excerpts being too long now.
In the meanwhile, a fix was proposed in the thread referenced above. I just thought I would bring this issue to light before making those kinds of changes, I'd prefer no to if possible.
#6
in reply to:
↑ 3
@
9 years ago
Replying to swissspidy:
One site mentioned in the support thread referenced above looks like it's using the zh_TW locale.
So, zh_CN translated the string as characters_excluding_spaces
, and zh_TW as words
.
@ocean90, is there a way to track down which locales had characters
before [33440] and translated the new string as words
? Sounds like we should probably ping them to correct the translations as needed.
#7
@
9 years ago
Just to be sure, I did a quick verification of all English locales to ensure they had translated (or didn't translate) the string properly:
- en-AU: https://translate.wordpress.org/projects/wp/dev/en-au/default?filters[status]=either&filters[original_id]=533157&filters[translation_id]=21582074
- en-CA: https://translate.wordpress.org/projects/wp/dev/en-ca/default?filters[status]=either&filters[original_id]=533157&filters[translation_id]=21604790
- en-GB: https://translate.wordpress.org/projects/wp/dev/en-gb/default?filters[status]=either&filters[original_id]=533157&filters[translation_id]=21581902
- en-NZ: https://translate.wordpress.org/projects/wp/dev/en-nz/default?filters[status]=either&filters[original_id]=533157&filters[translation_id]=21673870
No issues with any of those strings. All report back "words," as expected. To compare, here's the same string (or similar; we changed it in 4.3) from the relevant 4.2 projects (en-NZ doesn't have a 4.2.x translation):
- en-AU: https://translate.wordpress.org/projects/wp/4.2.x/en-au/default?filters[status]=either&filters[original_id]=227761&filters[translation_id]=10854951
- en-CA: https://translate.wordpress.org/projects/wp/4.2.x/en-ca/default?filters[status]=either&filters[original_id]=227761&filters[translation_id]=10854950
- en-GB: https://translate.wordpress.org/projects/wp/4.2.x/en-gb/default?filters[status]=either&filters[original_id]=227761&filters[translation_id]=10854949
Again, all report back "words," as expected.
How sure are we that this is related to r33440? Has anyone reproduced with stock 4.2.x / 4.3 installs and Twenty Fifteen?
#8
@
9 years ago
See also https://i18n.trac.wordpress.org/changeset/29247/ for zh_CN
as they used to ship a custom word count function in their distribution package, this was removed 20th August, ~2 days after WordPress 4.3 was released.
#9
@
9 years ago
- Keywords close added
- Milestone changed from 4.3.1 to Awaiting Review
Without further data, there's not much we can do here. It appears to be related to a non-English locale, in which case it will need to get reported to that localization team. If we can track down which locale, I'm happy to contact them.
#11
@
9 years ago
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, '' )
The change made to
wp_trim_words()
in r33440 might be the culprit here. It changed the translation context of the string which controls whether words or characters are used for the excerpt trimming.