Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

rikay on "Help needed: Adding YouTube parameters to oEmbed function"

$
0
0

Hi there,

I want to add these youtube parameters ?rel=0&?wmode=transparent&iv_load_policy=3&showinfo=0&vq=hd1080 to the youtube iframe that is created with the oembed function. For Example: pasting a youtube link (http://www.youtube.com/watch?v=-McFIAlP0Ow) inside a post will now only result in this:

<iframe width="100%" height="394" src="http://www.youtube.com/embed/-McFIAlP0Ow?feature=oembed" frameborder="0" allowfullscreen="" style="height: 420px;"></iframe>

I want the oembed function to automatically add the earlier mentioned parameters, so the iframe will look like this:

<iframe width="100%" height="394" src="http://www.youtube.com/embed/-McFIAlP0Ow?feature=oembed?rel=0&?wmode=transparent&iv_load_policy=3&showinfo=0&vq=hd1080" frameborder="0" allowfullscreen="" style="height: 420px;"></iframe>

I know i can add these parameters manually by adding them to the iframe html code provided by youtube. But i have a lot of bloggers and want to make it as simple as possible for them to create youtube posts. So rather then let them use the youtube iframe code i want them to just paste the youtube link inside the posts and let oembed do all the work for them.

I already know the oembed functions are located in wp-includes/class-oembed.php, but my lack of javascript and php skills stops me from randomly adding coding to this file.

I really hope someone can provide me with the right piece of php coding or javascript!

Thanks and Merry Christmas to all of you!


Viewing all articles
Browse latest Browse all 8245

Trending Articles