This is not and issue, it's actually an add for the plugin.
For those migrating from WordPress.com blogs:
You probably have used the YouTube tags… they go like this:
(example)
I just migrated to self-hosted, imported all my posts, and ended up with tons of tags like that in the middle of my posts, because I couldn't find any YouTube plugins that used the same tags as WordPress.com
So I decided to pick a plugin and modify it so it works with that.
Here's what I done:
Using a code editor (Notepad++), opened "smartyoutube.php", and on line 445, added this:
This is exactly what I'm looking for, but it doesn't work in the lastest version of the plugin. I know the line number changed to 555, but putting it in there doesn't work. Any ideas?
Okay I figured it out. On the current version, this is how you do it.
Change line #538 to:
if (( strpos($the_content, "httpv")!==FALSE ) OR ( strpos($the_content, "[youtube")!==FALSE )) {
Then on #555 add:
// This is for [youtube=url] support preg_match_all("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^<\\s]*)\\]/", $the_content, $matches, PREG_SET_ORDER); foreach($matches as $match) { $the_content = preg_replace("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^\\s<]*)/", yte_tag($match[3], 0), $the_content, 1); }
Vladimir’s WordPress Forum
Support for WordPress.com migration…
0:36
25 August, 2008
XSportSeeker
Great plugin Vladimir!
This is not and issue, it's actually an add for the plugin.
For those migrating from WordPress.com blogs:
You probably have used the YouTube tags… they go like this:
(example)
I just migrated to self-hosted, imported all my posts, and ended up with tons of tags like that in the middle of my posts, because I couldn't find any YouTube plugins that used the same tags as WordPress.com
So I decided to pick a plugin and modify it so it works with that.
Here's what I done:
Using a code editor (Notepad++), opened "smartyoutube.php", and on line 445, added this:
preg_match_all("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^<\\s]*)\\]/", $the_content, $matches, PREG_SET_ORDER);
foreach($matches as $match) {
$the_content = preg_replace("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^\\s<]*)/", yte_tag($match[3], 0), $the_content, 1);
}
Just in case someone is also looking for this, or even if you want to add it to your plugin Vladimir.
[]'s
0:42
25 August, 2008
Vladimir
posts 707
Great addon, surely will be useful for users migrating from WordPress.com.
Cheers
16:47
9 April, 2009
Daniel
This is exactly what I'm looking for, but it doesn't work in the lastest version of the plugin. I know the line number changed to 555, but putting it in there doesn't work. Any ideas?
21:24
12 April, 2009
Daniel
Okay I figured it out. On the current version, this is how you do it.
Change line #538 to:
( strpos($the_content, "[youtube")!==FALSE )) {
Then on #555 add:
preg_match_all("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^<\\s]*)\\]/", $the_content, $matches, PREG_SET_ORDER);
foreach($matches as $match) {
$the_content = preg_replace("/\\[youtube\\=http:\\/\\/([a-zA-Z0-9\\-\\_]+\\.|)youtube\\.com\\/watch(\\?v\\=|\\/v\\/)([a-zA-Z0-9\\-\\_]{11})([^\\s<]*)/", yte_tag($match[3], 0), $the_content, 1);
}
Then it works!
22:43
6 February, 2012
jazzylee
Would it be possible to migrate from the "IFRAME Embed For YouTube" plugin?
It uses code like this