problem with limit submissions per time period

[ad_1]

Hi Team,

I am using the following filter to limit the submissions forms per user’s email per month, but unfortunately, each user can submissions several forms with one email.
yours document:
https://formidableforms.com/knowledgebase/frm_validate_entry/#kb-limit-submissions-per-time-period-or-any-stat
Is this filter still valid?
My code is:
Field 182 is the email field of my users

add_filter('frm_validate_entry', 'check_submitted', 20, 2);
function check_submitted($errors, $values){
	if  ( $values['form_id'] !== 6 ) {//Change 30 to the ID of your form 
		return $errors;
	}
	
	$entries_submitted = FrmProStatisticsController::stats_shortcode( array( 'id' => 182, 'type' => 'count', 'user_id' => 'current',  'created_at_greater_than' => 'this month' ) );//change the params to the params of your stat

	if ( $entries_submitted >= 1 ){//change 1 to your limit number
		$errors['too_many'] = 'You filled this form this month, please register the feedback in the next month.';//Change this to your error message
	}

	return $errors;
}

BR

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer