WordPress.org

Support

Support » Plugins and Hacks » Auto Post Thumbnail » [Plugin: Auto Post Thumbnail] how to bypass img src that doesn't end with .jpg extension

[Plugin: Auto Post Thumbnail] how to bypass img src that doesn't end with .jpg extension

Viewing 2 replies - 1 through 2 (of 2 total)
  • // Get all images from post's body
        preg_match_all('/<\s*img [^\>]*src\s*=\s*[\""\']?([^\""\'>]*)/i', $post[0]->post_content, $matches);

    is that line i have to edit?
    i need to skip everything except .jpg or .gif or .png extension…

    example:

    <img border="0" alt="" src="http://dynamic1.example.com/www/delivery/avw.php?zoneid=3&n=a4b27fb" />

    i don’t want the plugin search for that… only .jpg or .gif or .png

    any news about the correct preg_match_all to extract .jpg .gif .png only? help is really appreciated…thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Auto Post Thumbnail] how to bypass img src that doesn't end with .jpg extension’ is closed to new replies.
Skip to toolbar