I have a localhost installed version of the latest WordPress on my server, and have begun designing my own plug, but am trying to learn a bit more about how WordPress works first.
I'm currently looking for a method to execute a terminal command (or just an application that runs on the server) every time a new post has been created. Even better if possible, to run a different command depending on what category the post was made in. Is something like this possible? Thanks in advance!
Try writing the function and using the action hook with publish_post
as described here http://codex.wordpress.org/Plugin_API/Action_Reference
So it would be like this:
<?php
function my_custom_function(){
//stuff to do on new post
}
add_action('publish_post', 'my_custom_function');
?>
Hope this helps. I am not sure about the terminal execution but @thenetimp seems to have a handle on that.
You'd use the php command exec() or shell_exec() they are both slightly different please read the docs on both.
http://php.net/manual/en/function.shell-exec.php