wc_post_content_has_shortcode( string $tag = '' )
Checks whether the content passed contains a specific short code.
Description Description
Parameters Parameters
- $tag
-
(Optional) Shortcode tag to check.
Default value: ''
Return Return
(bool)
Source Source
File: includes/wc-conditional-functions.php
function wc_post_content_has_shortcode( $tag = '' ) { global $post; return is_singular() && is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $tag ); }