• joost de keijzer

    (@joostdekeijzer)


    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;
        }

    https://wordpress.org/plugins/oembed-in-library/

  • The topic ‘Display oembed in 3.5 media browser detail view’ is closed to new replies.