Opened 15 years ago
Last modified 7 years ago
#17039 new defect (bug)
the_excerpt() - <!--more--> handling
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1 |
| Component: | Formatting | Keywords: | needs-refresh |
| Focuses: | Cc: |
Description
If a post has a manually inserted <!--more--> before the default break at the excerpt length, then the_excerpt() fails to generate any [...] or call the "excerpt_more" filter. Thus, there is no indication that there is more content to the post.
Attachments (2)
Change History (9)
@
15 years ago
wp_trim_excerpt() isn't fired if post_password_required() is true, so drop internal check
#2
@
15 years ago
Last patch does have the slight difference that if it's called by a function other than get_the_excerpt() that fails to replicate the password required check, it will return the actual excerpt rather than a mangled excerptified password form.
#3
@
15 years ago
This was noticed during Twenty Ten development. See #13361 for relevant conversation.
Note: See
TracTickets for help on using
tickets.
The issue can be traced back to using
get_the_content()inwp_trim_excerpt()which cuts off at<!--more-->regardless of the caller function and doesn't have a more text provided for it.Following patch splices in a minimal version of
the_content()rather than trying to bend the existing code or use a hacky workaround such as$more = 1Cut:
<!--noteaser-->checks which sets$stripteaser: isn't used unless$moreis trueif ( count($content) > 1 ): only invokesforce_balance_tags()since$moreis false and$more_link_textis empty, which is unnecessary since westrip_tags()Not cut:
post_password_required()check, though it's overridden bythe_excerpt()$previewcheck: is this needed?