[wp-trac] [WordPress Trac] #44859: Add filter to has_post_thumbnail() to override default thumbnail use

WordPress Trac noreply at wordpress.org
Thu Jan 10 03:15:28 UTC 2019


#44859: Add filter to has_post_thumbnail() to override default thumbnail use
-----------------------------+-----------------------------
 Reporter:  rzen             |       Owner:  SergeyBiryukov
     Type:  enhancement      |      Status:  reviewing
 Priority:  normal           |   Milestone:  Future Release
Component:  Post Thumbnails  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:
-----------------------------+-----------------------------

Comment (by desrosj):

 Thanks for this one, @rzen. I think a filter here is reasonable.

 [attachment:"44859.2.diff"] has the following adjustments to
 [attachment:"44859.diff"]:

 - Correctly pass a `bool` to the first parameter of the filter.
 - Include the thumbnail image ID as an optional third parameter for the
 filter. This could be used to not show a post thumbnail that has a
 specific meta property.
 - Improve the inline documentation. Previously, the `$post` param left out
 some potential types and had a typo in the variable name.
 - Updated `since` to `5.1.0`.

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


More information about the wp-trac mailing list