Saving the User’s ID along with the vote
-
Hi there,
Just wanted to share something I needed for this plugin: save the user’s ID when they answer a poll or fill out a survey.
I was happy to see Forminator uses filters, and was thus able to hook into that logic to register the info I wanted on the database.
I created a small plugin but I suppose you could just run this in your theme’s functions.php file if the plugin is in mu-plugins/. The code is super simple:
function forminator_saveUserID($items) { $items[] = [ 'name' => '_forminator_user_id', 'value' => get_current_user_id() ]; return $items; } add_filter('forminator_polls_submit_field_data', 'forminator_saveUserID');
I have already shared this with the Forminator team, maybe they’ll come up with a cleaner solution!
I hope this helps people that are in my situation!
Best,
Chris
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Saving the User’s ID along with the vote’ is closed to new replies.