0

I am trying to understand the code of 'Awesome Support' plugin code. I am stuck at the following line:

<?php do_action( 'wpas_after_ticket_submit' ); ?>

As far I know do_action(); executes functions hooked on a specific action hook. And do_action(); receive two argument.
First one is required and it is the function which will be executed and second one is optional which is the additional argument passed to the function. As only one argument is being passed, it is definitely sure that: wpas_after_ticket_submit is the function which definition should be done inside plugin.

I searched this function through the entire plugin but no function with such name found! How this <?php do_action( 'wpas_after_ticket_submit' ); ?> line works.
I am apologizing if I am wrong with my understanding of hook.

4

wpas_after_ticket_submit is the hook name, not the function name. Functions are hooked to it with add_action() by setting the first argument of add_action() to wpas_after_ticket_submit, and the function name as the second argument:

add_action( 'wpas_after_ticket_submit', 'function_to_hook' );

So you need to find a use of add_action() where the first argument is wpas_after_ticket_submit. The 2nd argument would then be name of the actual function that is hooked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.