Domanda

In wordpress I have comeaccross the word hooks, I have implemented few of them in my custom theme's function.php, I am trying to edit someone's code, I see he wrote few hooks inside the plugins settings.php file itself.

ex- We are using the plugin Contact Form 7, and wanted to add some more data to email before sending them, hence he wrote the hooks inside settings.php which I am not sure is correct or wrong.

Can some-one advice me as what is the best place to write our hooks for wordpress plugins so that it will not affect the plugin when there is an upgrade.

È stato utile?

Soluzione

Continue to use functions.php. If it starts to become a bit cluttered separate into includes. ie...

include_once('inc/cf7_custom.php');

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top