Display oembed in 3.5 media browser detail view
-
Currently, in the 3.5 media browser when opening an oembed attachment the icon is displayed.
Below a crude fix.
Add to
plugins_loaded()
methodadd_filter( 'wp_prepare_attachment_for_js', array( $this, 'wp_prepare_attachment_for_js' ), 10, 3);
New method
public function wp_prepare_attachment_for_js($response, $attachment, $meta) { if( 'oembed' == $response['type']) { $oembed = $this->__getpreview($response['url']); $response['compat']['item'] .= "<script type='text/javascript'>jQuery('.thumbnail-oembed').html('{$oembed}');</script>"; } return $response; }
- The topic ‘Display oembed in 3.5 media browser detail view’ is closed to new replies.