Search
 
SCRIPT & CODE EXAMPLE
 

PHP

formidable forms formsLimit logged-in users to two entries per day

add_action('frm_display_form_action', 'check_entry_count', 8, 3);
function check_entry_count($params, $fields, $form){
  remove_filter('frm_continue_to_new', '__return_false', 50);
  global $user_ID;
  if($form->id == 5 and !is_admin()){ //replace 5 with your form ID
    $count = FrmEntry::getRecordCount("form_id=". $form->id ." AND it.created_at > '". gmdate('Y-m-d')." 00:00:00' AND user_id=".$user_ID); 
    //$count = FrmEntry::getRecordCount("form_id=". $form->id ." AND it.created_at > '". gmdate('Y-m')."-01 00:00:00' AND user_id=".$user_ID); // uncommented this line to limit by month instead of day
    if($count >= 2){ //change 2 to your limit
      echo 'This form is closed';
      add_filter('frm_continue_to_new', '__return_false', 50);
    }
  }
}
Comment

PREVIOUS NEXT
Code Example
Php :: Comment supprimer les avis sur les produits de votre boutique WooCommerce 
Php :: wordpress auto save draft 
Php :: php numeros enteros 
Php :: to create html document you require a 
Php :: Removing the additional information tab using PHP code snippet 
Php :: standalone laravel orm 
Php :: withCount laravel assign generic name 
Php :: laravel orm tutorial 
Php :: CausesActivity trait 
Php :: smarty shorthand if 
Php :: merge cell collumn phpOffice 
Php :: send parameter to function in php can null 
Php :: run seeder command in laravel 
Php :: download xampp php 5.3 for windows 7 64 bit 
Php :: php shell_exec must be connected to a terminal 
Php :: symfony request 
Php :: php make simple loop of number elevated to exponent without pow 
Php :: drop down list display only seleted item only 
Php :: how exactly works prompt parameter wp skipping password 
Php :: PHP: how to "clone from" another object of same class 
Php :: bu7scador con laravel 
Php :: javascript,php error 
Php :: caculator 
Php :: laravel DomPDF live preview 
Php :: https://stackoverflow.com/questions/58589741/angular-8-hide-divs-and-show-div-on-button-click 
Php :: snippet doctrine orm with types 
Php :: ascii vrednosti php 
Php :: PHP include causes white space at the top of the page 
Php :: Laravel Auth successfully logged in but keep redirecting to login page and not showing failed error flash message 
Php :: simple using mdb with php script PDO 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =