Forms : Custom Action = Fatal error ?

[ad_1]

Hello,

Thanks for the feedback!

The action() you see in the documentation are simply describing the available variations for the said hook. You should choose one variation and use add_action() in your code, as in the example code.

For example, if you want to target all custom actions named my-action, in any form:

add_action('acfe/form/validate_my-action', 'my_form_validation', 10, 2);
function my_form_validation($form, $action){

// ...

}

Or, if you want to target the custom action named my-action in the form named my-form:

add_action('acfe/form/validate_my-action/form=my-form', 'my_form_validation', 10, 2);
function my_form_validation($form, $action){

// ...

}

Hope it helps!

Have a nice day!

Regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer