Currently, in the 3.5 media browser when opening an oembed attachment the icon is displayed.
Below a crude fix.
Add to plugins_loaded()
method
add_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;
}
]]>
Hi,
With the 3.5 MediaBrowser, the icons are not displayed. The 3.5 media browser uses an ajax_admin call to retrieve a json of attachment data.
Moving add_filter( 'icon_dirs', array( $this, 'add_icons_dir') );
from admin_menu()
to plugins_loaded()
fixes this.