[wp-trac] [WordPress Trac] #33070: the_thumbnail_url or similar

WordPress Trac noreply at wordpress.org
Wed Sep 23 18:35:21 UTC 2015


#33070: the_thumbnail_url or similar
-----------------------------+-----------------------------
 Reporter:  atomicjack       |       Owner:  wonderboymusic
     Type:  enhancement      |      Status:  reopened
 Priority:  normal           |   Milestone:  4.4
Component:  Post Thumbnails  |     Version:
 Severity:  minor            |  Resolution:
 Keywords:  has-patch        |     Focuses:  template
-----------------------------+-----------------------------

Comment (by Frank Klein):

 Replying to [comment:24 pathartl]:
 > Shouldn't `get_the_post_thumbnail_url()` return `false` if no URL is
 found?

 Yes, especially because `wp_get_attachment_image_url()` returns `false`
 according to r34372.

 So actually we wouldn't need the `isset()` check in
 `get_the_post_thumbnail_url()`, the function could be a one-liner:
 {{{
 return wp_get_attachment_image_url( get_post_thumbnail_id( $post ), $size
 );
 }}}

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


More information about the wp-trac mailing list