Avatar of steva
steva

asked on 

Strange use of WordPress add_action()

I expect add_action() to specify a hook name and then a function to call when the hook fires, but I came across the text below in "WordPress Web Application Development, 2nd ed on page 29:

 “We need to define AJAX handler functions using the WordPress add_action function:
add_action( ‘wp_ajax_mark_answer_status’, ‘wpwa_mark_answer_status’ );

There's no existing hook with the name "wp_ajax_mark_answer_status" so could someone explain what's going on?

Thanks for your help.
WordPress

Avatar of undefined
Last Comment
steva

8/22/2022 - Mon