Gravityforms limit submission – once for user, unlimited for guest

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
public function context() {
 
    // rule targets specific user, if this user is different we don't need to test the rule
    if ( $this->user_id != 'all' ) {
        if ( $this->user_id != get_current_user_id() ) {
            return false;
        }
         
    }
    if($this->user_id == "all")
    {
        if(get_current_user_id()===0)
        {
            return false;
        }
    }
 
    return true;
}

File: gp-limit-submissions/includes/GPLS_Rule_User.php

Plugin: https://gravitywiz.com/documentation/gravity-forms-limit-submissions


Posted

in

,

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *