-
-
Save kjohnson/87ee6f3d3b6c252f6a0a9ff8c88ae8ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @tag my_ninja_forms_processing | |
* @callback my_ninja_forms_processing_callback | |
*/ | |
add_action( 'my_ninja_forms_processing', 'my_ninja_forms_processing_callback' ); | |
/** | |
* @param $form_data array | |
* @return void | |
*/ | |
function my_ninja_forms_processing_callback( $form_data ){ | |
$form_id = $form_data[ 'form_id' ]; | |
$form_fields = $form_data[ 'fields' ]; | |
foreach( $form_fields as $field ){ | |
$field_id = $field[ 'id' ]; | |
$field_key = $field[ 'key' ]; | |
$field_value = $field[ 'value' ]; | |
// Example Field Key comparison | |
if( 'my_field' == $field[ 'key' ] ){ | |
// This is the field that you are looking for. | |
} | |
} | |
$form_settings = $form_data[ 'settings' ]; | |
$form_title = $form_data[ 'settings' ][ 'title' ]; | |
} |
I'm trying to write my own payment api, using ninja forms. Where would I save my custom action function?
You should save the action in your themes' function.php file. Further detail is here
Dear link. What's up with all the bad quality documentation in this project? Lots of docs, but low quality.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to write my own payment api, using ninja forms. Where would I save my custom action function?