-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Post Excerpt length when there's no excerpt and post content is used instead #61888
base: trunk
Are you sure you want to change the base?
Fix Post Excerpt length when there's no excerpt and post content is used instead #61888
Conversation
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Hi, Thanks for contributing; I don't have enough time to review at the moment but I do recall that excerpts have been an issue for sometime with multiple efforts to fix it; see #48598 (comment) and possibly #53570 and #49612 as well |
What?
Post Excerpt allows users to set the excerpt length in Editor (10 - 100 words). If a post has no excerpt, the post content is taken as a fallback. Post Content is truncated internally before reaching the Excerpt block to 55 words with default WordPress ellipsis:
[…]
instead of Excerpts ellipsis…
.Check the screenshot below, the excerpt (pink background) length is set to 100 words:
Why?
In get_post_excerpt we read:
then in wp_trim_excerpt:
How?
Before calling
get_post_excerpt
we call aexcerpt_length
filter and pass$excerpt_length
attribute if set.Testing Instructions
Example content
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus sed nibh blandit, sodales enim aliquet, ultricies ligula. Praesent enim lectus, gravida a sapien eget, venenatis tempor ligula. Etiam cursus, nisl id molestie rutrum, ex velit volutpat arcu, at blandit quam lectus ut urna. Sed at venenatis turpis, convallis laoreet ante. Nulla lobortis odio non est eleifend, eu vulputate arcu pharetra. Pellentesque porta ante non mauris rutrum consectetur. Quisque nulla neque, vestibulum sed consectetur eget, pellentesque quis felis. Nullam maximus felis neque, a efficitur velit venenatis vitae. Praesent elit sem, bibendum id malesuada sit amet, tristique non turpis. Vivamus varius venenatis sem auctor semper. Cras imperdiet risus diam, sit amet tincidunt dui dictum posuere.Duis ut tellus fermentum arcu efficitur posuere. Sed tincidunt, nulla a porttitor sagittis, felis felis condimentum felis, ut bibendum augue lacus eu orci. Vestibulum consequat condimentum viverra. Duis pharetra turpis vel varius malesuada. Quisque id velit id.
MAX NUMBER OF WORDS
to 100Testing Instructions for Keyboard
Screenshots or screencast