[wp-trac] [WordPress Trac] #32621: Tumblr Embeds not Working

WordPress Trac noreply at wordpress.org
Fri Jun 12 01:44:50 UTC 2015


#32621: Tumblr Embeds not Working
--------------------------+------------------------------
 Reporter:  chris.lewis2  |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Embeds        |     Version:  4.2.2
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by chris.lewis2):

 This is kinda sketchy but seemed to fix the issue for me.

 {{{
 wp_oembed_remove_provider( '#https?://(.+)\.tumblr\.com/post/.*#i' );
 wp_embed_register_handler( 'tumblr',
 '#https?://(.+)\.tumblr\.com/post/.*#i', function( $matches, $attr, $url,
 $rawattr ) {
     $wp_oembed = _wp_oembed_get_object();
     $args = '';
     $provider = 'https://www.tumblr.com/oembed/1.0';
     if( false === $data = $wp_oembed->fetch( $provider, $url, $args ) ) {
         return false;
     }
     if( property_exists( $data, 'response' ) ) {
         $data = json_decode( $data->response );
     }
     return apply_filters( 'oembed_result', $wp_oembed->data2html( $data,
 $url ), $url, $args );
 } );
 }}}

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


More information about the wp-trac mailing list