Check If Post Content Has Shortcode

This PHP code enables you to execute a function if the post contains or doesn’t contain a short code.

has_shortcode( $content, '$tag' )

The code uses the has_shortcode function which includes 2 parameters.

$content – The content to search the single post for.
$tag – The short code to search for in each single post.

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.