Convert all youtube link to embed

I have this function to convert any YouTube URL in any post or page to embed :- function embed_youtube_an($post_content) { global $posts; //preg_match(‘|http://www.youtube.com/watch?v=([a-zA-Z0-9]+)|’, $posts->post_content, $matches); preg_match(‘#http://w?w?w?.?youtube.com/watch\?v=([A-Za-z0-9\-_]+)#s’, $posts->post_content, $matches); if (!empty($matches[1])) { $post_content=”<object width=”415″ height=”250″>”; $post_content .= ‘<param name=”movie” value=”http://www.youtube.com/v/’ . $matches[1] . ‘&hl=en_US&fs=1&”></param>’; $post_content .= ‘<param name=”allowFullScreen” value=”true”></param>’; $post_content .= ‘<param name=”allowscriptaccess” value=”always”></param>’; $post_content .= … Read more

How to remove the embed_footer?

I’m trying to remove the entire embed_footer from WordPress embedded posts. By adding the following code in the functions.php, I was able to remove the site title and comments icon. But still, the share icon is there. add_filter(’embed_site_title_html’,’__return_false’); remove_action( ’embed_content_meta’, ‘print_embed_comments_button’ ); Is there a way to remove the entire embed_footer? Or can I remove … Read more

Any way to use a custom Parameter for vimeo embed without using an iframe?

I am trying to get some oembed parameters attached to my Vimeo clips. I tried to get it going using the following two instructions: Passing Parameters to a Vimeo link in a WordPress Custom Field – LimeCanvas.com Any way to use a custom parameter for YouTube embed without using an iframe – WordPress.SE.com Unfortunately what … Read more

How to overwrite youtube embed?

I really like how you can just paste a URL right into the post… such as: http://youtube.com/watch?v=xyz or http://vimeo.com/123456 What I want to do is change the default code for this to support the code from here: http://embedresponsively.com/ How can I go about overwriting the youtube and vimeo code, I’m assuming in functions.php somehow? 1 … Read more

Manipulating oembed_dataparse stopped working for YouTube embeds

My go-to code to manipulate YouTube embeds does not work anymore. Can anyone explain to me what I am doing wrong? This is my code in functions.php // OEMBED FILTER function bolster_oembed_filter( $return, $data ) { // YOUTUBE (ADD PARAMS, NOCOOKIE DOMAIN) if( is_object( $data ) && property_exists( $data, ‘provider_name’ ) && ‘YouTube’ === $data->provider_name … Read more