get_post_embed_html example


function get_oembed_response_data_rich( $data$post$width$height ) {
    $data['width']  = absint( $width );
    $data['height'] = absint( $height );
    $data['type']   = 'rich';
    $data['html']   = get_post_embed_html( $width$height$post );

    // Add post thumbnail to response if available.     $thumbnail_id = false;

    if ( has_post_thumbnail( $post->ID ) ) {
        $thumbnail_id = get_post_thumbnail_id( $post->ID );
    }

    if ( 'attachment' === get_post_type( $post ) ) {
        if ( wp_attachment_is_image( $post ) ) {
            $thumbnail_id = $post->ID;
        }
Home | Imprint | This part of the site doesn't use cookies.