Title: Uncaught ArgumentCountError
Last modified: November 14, 2018

---

# Uncaught ArgumentCountError

 *  Resolved [cvc1968](https://wordpress.org/support/users/cvc1968/)
 * (@cvc1968)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/uncaught-argumentcounterror/)
 * I have a function set up in functions.php to process a field at submission. Specifically
   a hidden honeypot checkbox field. This is the code:
 *     ```
       add_action( 'af/form/submission', 'honeypot_check' );
   
       function honeypot_check($form, $fields, $args) {
       	$human = af_get_field( 'human' );
       	if ($human) {
       		die();
       	}
       }
       ```
   
 * I got this from the af fields documentation.
 * I’ve read this error has something to do with the upgrade from php 5.6 to php
   7.2.
 * Here is the complete error log:
 *     ```
       PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function honeypot_check(), 1 passed in /home/account12/public_html/wp-includes/class-wp-hook.php on line 288 and exactly 3 expected in /home/account12/public_html/wp-content/themes/mytheme/functions.php:1325
       Stack trace:
       #0 /home/account12/public_html/wp-includes/class-wp-hook.php(288): honeypot_check(Array)
       #1 /home/account12/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters('', Array)
       #2 /home/account12/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
       #3 /home/account12/public_html/wp-content/plugins/advanced-forms/core/forms/forms-submissions.php(66): do_action('af/form/submiss...', Array, Array, Array)
       #4 /home/account12/public_html/wp-includes/class-wp-hook.php(284): AF_Core_Forms_Submissions->pre_form()
       #5 /home/account12/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
       #6 /home/account12/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
       #7 /home/account12/public_html/wp-setting in /home/account12/public_html/wp-content/themes/mytheme/functions.php on line 1325
       ```
   
 * I am unable to determine why only 1 argument is being passed or which argument
   it is.
 * Any guidance would be appreciated.

Viewing 1 replies (of 1 total)

 *  Plugin Author [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * (@fabianlindfors)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/uncaught-argumentcounterror/#post-10907829)
 * Hi!
 * You need to specify the number of arguments when registering your action. Like
   this: `add_action( 'af/form/submission', 'honeypot_check', 10, 3 );`.
 * Hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘Uncaught ArgumentCountError’ is closed to new replies.

 * ![](https://ps.w.org/advanced-forms/assets/icon-256x256.png?rev=1894254)
 * [Advanced Forms for ACF](https://wordpress.org/plugins/advanced-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-forms/reviews/)

## Tags

 * [ArgumentCountError](https://wordpress.org/support/topic-tag/argumentcounterror/)
 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 1 reply
 * 2 participants
 * Last reply from: [fabianlindfors](https://wordpress.org/support/users/fabianlindfors/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/uncaught-argumentcounterror/#post-10907829)
 * Status: resolved