Created
May 28, 2015 15:39
-
-
Save gwin/75a55a4b6becfdc53d75 to your computer and use it in GitHub Desktop.
Action my_wphd_new_message Basci Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Register action, notice fourth argument (3) | |
// it allows to pass 3 params to callback function | |
add_action("wphd_new_message", "my_wphd_new_message", 10, 3); | |
/** | |
* @var $thread Wphd_Model_Thread Current thread | |
* @var $message Wphd_Model_Message Current message | |
* @var $context string One of: "admin", "email-import", "submit-ticket", "tickets" | |
**/ | |
function my_wphd_new_message($thread, $message, $context) { | |
// do something with the ticket here | |
// once done save message and thread | |
$message->save(); | |
$thread->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment