WordPress.org

Ready to get started?Download WordPress

Forums

Auto Post Thumbnail
how to bypass img src that doesn't end with .jpg extension (3 posts)

  1. hero12
    Member
    Posted 1 year ago #

    hi,
    i would like to edit the php to bypass every img src that doesn't end with the .jpg extension. How to do it? Thanks :-D

    http://wordpress.org/extend/plugins/auto-post-thumbnail/

  2. hero12
    Member
    Posted 1 year ago #

    // 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

  3. hero12
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic