[wp-trac] [WordPress Trac] #39759: Make $thumbnail_id filterable in embed-content.php

WordPress Trac noreply at wordpress.org
Wed Feb 1 13:11:15 UTC 2017


#39759: Make $thumbnail_id filterable in embed-content.php
-------------------------+-----------------------------
 Reporter:  Ov3rfly      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Embeds       |    Version:  4.7.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Some images from photo agencies have special terms where/how to publish
 them. Use outside of the website might be prohibited.

 To be able to filter/replace these images (by looking at their title,
 description, excerpt or similar) a filter in embed-content.php would be
 helpful.

 Currently a theme needs to provide a modified copy of embed-content.php to
 catch these cases. Other details (size, shape) can be filtered already,
 but not the image itself.

 Suggested endhancement:

 {{{
                 if ( 'attachment' === get_post_type() &&
 wp_attachment_is_image() ) {
                         $thumbnail_id = get_the_ID();
                 }

                 // add this:
                 $thumbnail_id = apply_filters( 'embed_thumbnail_id',
 $thumbnail_id );

                 if ( $thumbnail_id ) {
 }}}
 Thanks for considering.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39759>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list