Support » Plugin: WordPress Gallery Plugin - NextGEN Gallery » preg_replace gallery images

  • Resolved RG1527


    I have a script i use to send e-newsletters (i basically assign a post to a custom post type and those posts are included in the email). The code below used to strip out all images but since a recent update gallery images are now being ignored and are being displayed in $content. Is there a similar way to exclude all images (regular and gallery) via preg_replace? Regular expressions are not my strong suit.

    $content = get_the_content();
    $content = preg_replace(“/<img[^>]+\>/i”, ” “, $content);
    $content = apply_filters(‘the_content’, $content);
    $content = str_replace(‘]]>’, ‘]]>’, $content);
    echo $content;

Viewing 1 replies (of 1 total)
  • Thread Starter RG1527


    I ended up just stripping them out with jquery

    in case anyone is interested in how it was pretty simple – I just empty the containing div.


Viewing 1 replies (of 1 total)
  • The topic ‘preg_replace gallery images’ is closed to new replies.