Tell us what you are trying to do?
I am trying to use toolset hooks to retrieve and modify form data.
I was trying to test this by using the 'cred_save_data' hook; however, I am unsure if I am properly calling the function. When trying to use a do_action() to call the hook, I get an error message indicating that only one argument is being passed in when there should be two. When utilizing hooks, can it automatically retrieve $post_id and $form_data or do we have to use another built in function to retrieve this data before passing it into the function as arguments? Also, is there a way to log data to the console through toolset (I am currently using a plugin to do so which utilizes the syntax: do_action( 'php_console_log', $my_string ) ).
Here is a test function I have written, to log the form id within the hook function (errors out when using do_action( 'cred_save_data'):
add_action( 'cred_save_data', 'my_save_data_action', 10, 2 );
function my_save_data_action( $post_id, $form_data){
if ($form_data['id']==3111) {
do_action( 'php_console_log', $form_data['id']);
}
}
do_action( 'cred_save_data', $post_id, $form_data)
What is the link to your site?
hidden link