Tag Info

New answers tagged

0

As your problem is to find YouTube URL from HTML contents, following link may help you: http://stackoverflow.com/a/5831191/147618 Here is required regex copied from the same link. // Linkify youtube URLs which are not already links. function linkifyYouTubeURLs($text) { $text = preg_replace('~ # Match non-linked youtube URL in the wild. ...


1

Maybe you should just add a custom field to accept the url itself, in stead of the wp_editor textarea; then append the video embed after you work with the input. Let me know if you need any help setting that up. OR: You could add a separete textarea to accept just comma separated or line-break separated urls (Because you stated below that you might need ...


0

What I guess (didn't try) doesn't work with the other solution might be that appending to the url before asking Vimeo for the embed code might just be ignored by Vimeo. So what I do is simply parse the response with a RegEx: $htmlcode = preg_replace("/(http:\/\/player.vimeo.com\/video\/[0-9]*)/i", '$1?title=0&portrait=0&byline=0&color=ffffff', ...



Top 50 recent answers are included