I have a custom table in my WordPress database named “post_votes” used for voting posts.
Whenever I publish a new post can I simultaneously add some data to that table as well?
I’m trying to achieve this without editing any wp core files. Perhaps a function if possible.
You’ll want to register a function in your plugin to this action hook:
{$new_status}_{$post->post_type}