Home > Blockchain >  Can I include a simple do_action() hook into my basic plugin?
Can I include a simple do_action() hook into my basic plugin?

Time:03-14

I have created a very simple wordpress plugin and I would like my future users to extend the features ia hooks.

Thus, my question is, is it ok for me to add the following hook in the core file?

do_action( 'test_success' );

Right now, I don't have any corresponding add_action() to the above hook, will it create any errors if I just add in do_action() without add_action() ?

I appreciate any comments and guidance, thank you in advance!

CodePudding user response:

No it does not create any errors. You can call this function almost anywhere and sometimes you have to send parameters to it as well. By specifying the parameter, users can access the list of parameters you have specified after calling add_action. To better understand the hooks, I recommend reading the following article : Hooks: Actions and Filters

  • Related