honeypot.php 393 B

12345678910111213141516
  1. <?php
  2. /**
  3. * Make sure that our honeypot wasn't filled in.
  4. */
  5. function nf_check_honeypot() {
  6. global $ninja_forms_processing;
  7. $hp_name = $ninja_forms_processing->get_extra_value( '_hp_name' );
  8. if ( $ninja_forms_processing->get_extra_value( $hp_name ) != '' ) {
  9. $ninja_forms_processing->add_error( 'honeypot', '' );
  10. }
  11. }
  12. add_action( 'ninja_forms_pre_process', 'nf_check_honeypot', 8 );