Answers.Body: <p>add_action defaults to 1 param: <a href="https://developer.wordpress.org/reference/functions/add_action/" rel="nofollow noreferrer">https://developer.wordpress.org/reference/functions/add_action/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-15T18:15:30.347Z
Answers.LastActivityDate: 2022-09-15T18:15:30.347Z
Answers.UserDisplayName: Demerit
Body: <p>Only the &quot;$formName&quot; variable is getting supplied to the hook callback. Why are the rest of the variables listed in the documentation not getting supplied?</p>
  <pre><code>add_action('civicrm_postProcess', 'onFormSubmit');
  
  function onFormSubmit() {
      $args = func_get_args(); // Returns [&quot;CRM_Contribute_Form_Contribution&quot;]
  }
  </code></pre>
  <p><a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/</a></p>
  
Tags: <wordpress><hooks><validation><actions><webhook>
Title: Why does civicrm_postProcess hook does not pass certain parameters?
ThreadText: # Why does civicrm_postProcess hook does not pass certain parameters?
  
  (Asked by: username_0 on 2022-09-15)
  
  Only the "$formName" variable is getting supplied to the hook callback. Why are the rest of the variables listed in the documentation not getting supplied?
  
  ```
  add_action('civicrm_postProcess', 'onFormSubmit');
  
  function onFormSubmit() {
      $args = func_get_args(); // Returns ["CRM_Contribute_Form_Contribution"]
  }
  
  ```
  
  <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_postProcess/>
  
  **Tags:** wordpress, hooks, validation, actions, webhook
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-09-15. Score: 1 | Accepted answer
  
  add\_action defaults to 1 param: <https://developer.wordpress.org/reference/functions/add_action/>
  
  
  ---
  
  