[wp-trac] [WordPress Trac] #39921: the_excerpt needs additional parameters to control teaser length and visibility of 'read more' link

WordPress Trac noreply at wordpress.org
Tue Feb 21 05:18:43 UTC 2017


#39921: the_excerpt needs additional parameters to control teaser length and
visibility of 'read more' link
-------------------------------+------------------------------
 Reporter:  subrataemfluence   |       Owner:
     Type:  enhancement        |      Status:  reopened
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.7.2
 Severity:  normal             |  Resolution:
 Keywords:  close              |     Focuses:  template
-------------------------------+------------------------------
Changes (by subrataemfluence):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Sorry for following up!

 What is the harm if we introduce two additional parameters? This will
 definitely give developers more control.

 Now regarding `apply_filters` and using a hook (`excerpt_length`) to a
 specific function, we can not use the same hook with a different function
 with different settings. Only one will be in action. Am I right?

 But if we have parameters introduced in the core method we then have the
 ability to pass value to it directly without writing additional function
 for customised output and hook it.

 According to what your said ("If a different setting is needed for
 different elements then a conditional statement can be used within the
 filters.") - if I take my above scenario as a use case, how I do this?
 What conditional statement/s I should use within the filters?

 Please don't think I am asking "how can I ..."!

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39921#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list