[wp-trac] [WordPress Trac] #35487: Update has_excerpt()

WordPress Trac noreply at wordpress.org
Sat Jan 16 12:18:54 UTC 2016


#35487: Update has_excerpt()
-------------------------------+------------------------------
 Reporter:  sebastian.pisula   |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  close              |     Focuses:
-------------------------------+------------------------------
Changes (by swissspidy):

 * keywords:   => close


Comment:

 Replying to [comment:5 sebastian.pisula]:
 > current fuction work bad too because in `$post->post_excerpt` I will be
 have excerpt and in get_the_excerpt I use filter to remove excerpt so
 `has_excerpt()` return `true` and `get_the_excerpt` return empty string ->
 except not exists

 This sounds like an edge case. If you do that and you want to make sure
 `get_the_excerpt()` is not empty, just use `if ( get_the_excerpt() { … }`
 instead of `has_excerpt()`.

 The ticket really is a wontfix in my eyes because it breaks backwards-
 compatibility. Devs expect it to check `$post->post_excerpt` and not
 `get_the_excerpt()`.

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


More information about the wp-trac mailing list