• 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)
  • Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @jakhris

    Hope you’re doing well and really appreciate the sharing here! ??

    I’ve already pinged our developers about it, we’ll keep you posted here as soon as we’ve got some insights on this.

    Thank you,
    Dimitris

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @jakhris,
    hope you’re doing well and I’m really sorry for the late response here.

    Our developers responded that there’s nothing wrong with this implementation as we are also passing the Poll ID on that filter, so limiting to specific Poll ID might be better in some use cases. The problem left, is displaying it on the submissions page, where we don’t have any filter hook there as we only display a chart.

    Warm regards,
    Dimitris

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.