Patri Dharmendra
Patri Dharmendra

Reputation: 39

Contact form 7 hooks, where can we write it to take it's advantage

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.

Upvotes: 0

Views: 661

Answers (1)

Joe Buckle
Joe Buckle

Reputation: 871

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

include_once('inc/cf7_custom.php');

Upvotes: 1

Related Questions