11 reputation
2
bio website bioeng.berkeley.edu
location
age
visits member for 2 years, 3 months
seen Aug 10 '12 at 23:24

Aug
1
comment Notify admin when page is edited?
Foolish me, the original script from the wpcodex works fine: add_action( 'save_post', 'my_project_updated_send_email' ); function my_project_updated_send_email( $post_id ) { //verify post is not a revision if ( !wp_is_post_revision( $post_id ) ) { $post_title = get_the_title( $post_id ); $post_url = get_permalink( $post_id ); $subject = 'A post has been updated'; $message = "A post has been updated on your website:\n\n"; $message .= "<a href='". $post_url. "'>" .$post_title. "</a>\n\n"; //send email to admin wp_mail( get_option( 'admin_email' ), $subject, $message ); } }
Aug
1
comment Notify admin when page is edited?
add_action( 'save_post', 'my_project_updated_send_email' ); function my_project_updated_send_email( $post_id ) { $post_title = get_the_title( $post_id ); $post_url = get_permalink( $post_id ); $subject = 'A post has been updated'; $message = "A post has been updated on your website:\n\n"; $message .= "<a href='". $post_url. "'>" .$post_title. "</a>\n\n"; //send email to admin wp_mail( get_option( 'admin_email' ), $subject, $message ); }
Aug
1
comment Notify admin when page is edited?
Hi! Well, that didn't work, but I managed to modify the script suggested at the WP codex. Unfortunately, it sends a mail every time there is an autosave as well. Code in next post, thanks for your help!
Aug
1
comment Notify admin when page is edited?
Thank you, I just reviewed that story. I had looked at most of those plugins, and they don't appear to be the answer for me, as they log but don't notify. I'd like to be warned immediately that changes are being made, not just be able to trace it after the fact. My site isn't really multi-user, but I do need to delegate editing authority to a few other staff and would like to keep an eye on changes.
Aug
1
comment Notify admin when page is edited?
Thank you, this looks perfect. However, I can't get it to work. I tried putting it in functions.php and then making it a plugin. It doesn't break anything, just no result when I save an update to a page. I also used the admin notification script on the wordpress codex page for save_post [link]codex.wordpress.org/Plugin_API/Action_Reference/save_post, and also had no result. Looks like the save_post action is not triggering for me? thanks