function the_content( $more_link_text = null, $strip_teaser = false) {
$append = '&w=480&rel=0';
$content = get_the_content( $more_link_text, $strip_teaser );
$content = apply_filters( 'the_content', $content );
$content = str_replace( ']]>', ']]>', $content );
$content = preg_replace('/^http:\/\/(?:www\.)?(?:youtube.com\/(?:v\/|watch[\/\#?])|(youtu\.be\/))[^
]*/im', '$0'.$append, $content);
echo $content;
}
Can any one fix this function that suppose to ?
This function doesn't work like it is supposed to, it must scan a WordPress post for YouTube links and add &w=480&rel=0 to the end of the link and put the link on a single line so it can works with WordPress auto embed, as like in below format.
blah blah blah
http://www.youtube.com/watch?v=yNNyzwSVRR0&w=480&rel=0
blah blah blah