Testing for shortcode output
-
Is there a way to test for shortcode output and perform actions based on that?
I’ve tried this code, but either it doesn’t run at all or it generates PHP out-of-memory errors.
if ( do_shortcode( '[so_show_offers]' ) != NULL ) { // take action }
Use case: I’m trying to redirect to a specific page if the shortcode has content; if not, then redirect to a different page.
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Testing for shortcode output’ is closed to new replies.