Wednesday, April 28, 2010

Create a plugin in WordPress

/*
Plugin Name: Just Published!
Plugin URI: http://forumone.com/
Description: Notify a user once a post has been published.
Author: Matt Gibbs
Version: 1.0.0
Author URI: http://forumone.com/
*/

function jp_email_user() {
mail('some@email.com', 'A new post has been published!', 'Some content');
}

add_action('publish_post', 'jp_email_user');
?>

No comments:

Post a Comment