Forum Replies Created

Viewing 1 replies (of 1 total)
  • Forum: Hacks
    In reply to: Author notification page
    Thread Starter zambo84

    (@zambo84)

    Ok thx for the answer, i have changed the code

    function my_project_updated_send_email( $post_id ) {
    
    	// If this is just a revision, don't send the email.
    	if ( wp_is_post_revision( $post_id ) )
    		return;
    	$to = $author ;
    
    	$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 .= $post_title . ": " . $post_url;
    
    	// Send email to admin.
    	wp_mail( example@example.com, $subject, $message );
    }
    add_action( 'save_post', 'my_project_updated_send_email' );

    This work to,, but i need to send the mail to the Author of the post, can some one explain me the corret code pls?

Viewing 1 replies (of 1 total)