Advertisement
tzvij

Class example of action function 2

Nov 20th, 2013
285
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.     $users = 'bob@example.org,susie@example.org';
  4.     mail($users,"sally's blog updated",'I just put something on my blog: http://blog.example.com');
  5.     return $post_ID;
  6.   }
  7. }
  8. $myEmailClass = new emailer();
  9. add_action('publish_post', array($myEmailClass, 'send'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement