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.

有帮助吗?

解决方案

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

include_once('inc/cf7_custom.php');

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top