Coralize all images
Hi, I was wondering if anyone could help me with a little problem I am trying to solve. I am trying to filter all my posts so that the images in them get made into coral URLs.
Here is the code I am using in a function:
$content = preg_replace( '/<img([^>]*)src=?([^:]*://)?([^ /"']*)([^>]*)([^<]*)/>/', '<img$1src=$2$3.nyud.net:8080$4/>', $content );
I am sure the regex is fine and it seems to work in non-dynamic tests. However, I can’t seem to write a plugin or a template hack to make it all hang together.
If anyone who has a bit of spare time and could help me out I would really appreciate it.
WP 2.0.4 PHP5
- The topic ‘Coralize all images’ is closed to new replies.