has_shortcode for content added after the content

I added some shortcode after the content using filter, like this:

add_filter( 'the_content', 'image_posts' );

but now that I run has_shortcode in another function, this returns false even though the shortcode is there (which was added using the above filter.

if ( has_shortcode( $content, 'gallery' ) ) {
   // return false 
}

how can I test the has_shortcode for contents added using add_filter?

Read more here: has_shortcode for content added after the content

Leave a Reply

Your email address will not be published. Required fields are marked *