Opened 13 years ago
Last modified 5 years ago
#17039 new defect (bug)
the_excerpt() - <!--more--> handling
Reported by: | wpweaver | 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)
@
13 years ago
wp_trim_excerpt() isn't fired if post_password_required() is true, so drop internal check
#2
@
13 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
@
13 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 = 1
Cut:
<!--noteaser-->
checks which sets$stripteaser
: isn't used unless$more
is trueif ( count($content) > 1 )
: only invokesforce_balance_tags()
since$more
is false and$more_link_text
is empty, which is unnecessary since westrip_tags()
Not cut:
post_password_required()
check, though it's overridden bythe_excerpt()
$preview
check: is this needed?