TJJones Posted November 14, 2019 Report Share Posted November 14, 2019 Is it possible to pass a WordPress user's email (without requiring a login) to the shortcode embedded from Caspio? Quote Link to comment Share on other sites More sharing options...
0 vidierre Posted May 26, 2021 Report Share Posted May 26, 2021 Hello @TJJones, to pass users details from Wordpress to a data page accepting external parameters I use some javascript in Wordpress collecting user data and building the script used to display Caspio datapage. I use such Javascript to build, with the Worpress plugin Snippets an ad-hoc shortcode used into Wordpress pages. Here is how I work: 1. Assume that my datapage use as external parameter [@usremail] and the deploy code is <script type="text/javascript" src="https://c2xxx999.caspio.com/dp/vd9990009990009990009990099/emb"></script> 2. I create a new snippet with this code function show_my_datapage( $atts ) { global $current_user, $user_login; get_currentuserinfo(); add_filter('widget_text', 'do_shortcode'); if ($user_login) return '<script type="text/javascript" src="https://c2xxx999.caspio.com/dp/vd9990009990009990009990099/emb?usremail='.$current_user->user_email.'">display_name></script>'; else return '<a href="' . wp_login_url() . ' ">Login</a>'; } add_shortcode( 'insert_my_datapage', 'show_my_datapage' ); 3. I use into my Wordpress page the shortcode [insert_my_datapage] With this method I can use all data from $current_user and fill as many parameters I need. Quote Link to comment Share on other sites More sharing options...
Question
TJJones
Is it possible to pass a WordPress user's email (without requiring a login) to the shortcode embedded from Caspio?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.