[wp-trac] [WordPress Trac] #17039: the_excerpt() - <!--more--> handling

WordPress Trac wp-trac at lists.automattic.com
Wed Apr 6 14:23:59 UTC 2011


#17039: the_excerpt() - <!--more--> handling
--------------------------+------------------------------
 Reporter:  wpweaver      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Formatting    |     Version:  3.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
--------------------------+------------------------------
Changes (by kawauso):

 * keywords:   => has-patch


Comment:

 The issue can be traced back to using `get_the_content()` in
 `wp_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 true

 * `if ( count($content) > 1 )`: only invokes `force_balance_tags()` since
 `$more` is false and `$more_link_text` is empty, which is unnecessary
 since we `strip_tags()`

 Not cut:

 * `post_password_required()` check, though it's overridden by
 `the_excerpt()`

 * `$preview` check: is this needed?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17039#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list