display error message when return is empty
-
Hi so I am usng this snippet for a custom shortcode to display a users submitted events in their buddypress profile
function custom_shortcode(){ $user_id = bp_displayed_user_id(); return do_shortcode( '[eo_events author='.$user_id.']' ); } add_shortcode( 'eo_custom_shortcode', 'custom_shortcode' );
I am very new to php and trying to learn. I would like to add an if statement to display some text like “sorry no events yet” when the shortcode returns no events. How do I do this as I dont know what the return type of a shortcode is…
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘display error message when return is empty’ is closed to new replies.