tzvij

Class example of action function 2

Nov 20th, 2013
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. class emailer {
  2.   function send($post_ID)  {
  3.     mail($users,"sally's blog updated",'I just put something on my blog: http://blog.example.com');
  4.     return $post_ID;
  5.   }
  6. }
  7. $myEmailClass = new emailer();
  8. add_action('publish_post', array($myEmailClass, 'send'));
Advertisement
Add Comment
Please, Sign In to add comment