Skip to main content
added 45 characters in body
Source Link
Tahi Reu
  • 308
  • 1
  • 14

I know it's old question but someone may still need this, especially because shortcode_exists() may not work for some plugin shortcodes:

if$shortcode_result (= do_shortcode('[your_shortcode]');

if ($shortcode_result != [your_shortcode]) && 
    !empty($shortcode_result))] { 

    // do what you need 

} else {
    // this is not valide shortcode
}

I know it's old question but someone may still need this, especially because shortcode_exists() may not work for some plugin shortcodes:

if (do_shortcode('[your_shortcode]') != [your_shortcode] {
 // do what you need
} else {
 // this is not valide shortcode
}

I know it's old question but someone may still need this, especially because shortcode_exists() may not work for some plugin shortcodes:

$shortcode_result = do_shortcode('[your_shortcode]');

if ($shortcode_result != [your_shortcode]) && 
    !empty($shortcode_result))] { 

    // do what you need 

} else {
    // this is not valide shortcode
}
Source Link
Tahi Reu
  • 308
  • 1
  • 14

I know it's old question but someone may still need this, especially because shortcode_exists() may not work for some plugin shortcodes:

if (do_shortcode('[your_shortcode]') != [your_shortcode] {
 // do what you need
} else {
 // this is not valide shortcode
}