wc_post_content_has_shortcode() WC 1.0
Checks whether the content passed contains a specific short code.
Хуков нет.
Возвращает
true/false.
Использование
wc_post_content_has_shortcode( $tag );
- $tag(строка)
- Shortcode tag to check.
По умолчанию: ''
Код wc_post_content_has_shortcode() wc post content has shortcode WC 4.9.0
function wc_post_content_has_shortcode( $tag = '' ) {
global $post;
return is_singular() && is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, $tag );
}