get_embed_handler_html example

$attr    = wp_parse_args( $attrwp_embed_defaults( $url ) );

        $this->last_attr = $attr;

        /* * KSES converts & into & and we need to undo this. * See https://core.trac.wordpress.org/ticket/11311 */
        $url = str_replace( '&', '&', $url );

        // Look for known internal handlers.         $embed_handler_html = $this->get_embed_handler_html( $rawattr$url );
        if ( false !== $embed_handler_html ) {
            return $embed_handler_html;
        }

        $post_id = ( ! empty( $post->ID ) ) ? $post->ID : null;

        // Potentially set by WP_Embed::cache_oembed().         if ( ! empty( $this->post_ID ) ) {
            $post_id = $this->post_ID;
        }

        
        $data = get_oembed_response_data_for_url( $url$args );

        if ( $data ) {
            return $data;
        }

        $data = _wp_oembed_get_object()->get_data( $url$args );

        if ( false === $data ) {
            // Try using a classic embed, instead.             /* @var WP_Embed $wp_embed */
            $html = $wp_embed->get_embed_handler_html( $args$url );

            if ( $html ) {
                // Check if any scripts were enqueued by the shortcode, and include them in the response.                 $enqueued_scripts = array();

                foreach ( $wp_scripts->queue as $script ) {
                    $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src;
                }

                return (object) array(
                    'provider_name' => __( 'Embed Handler' ),
                    
Home | Imprint | This part of the site doesn't use cookies.