I don’t understand how add_action and do_action work in tandem. The former executes the code already…what is do_action for?
The do_action() function executes any code that’s been hooked with add_action(). The only reason your function_save_custom_form_data() function runs is because the WP Forms plugin has added a call to do_action() inside its code. So what using do_action() in a theme or plugin does is allow other plugins or themes to run code during its processes. … Read more