• Resolved curiositykillsthecat

    (@curiositykillsthecat)


    I am trying to get notified when a sub-admin edited a post, and know who edited it.

    I am able to get WP to notify me via email, but it can only provide the ID (and by extension the name) of the original author, not the person edited it. Any suggestion on how to getting what I want?

    My current codes:

    $aid = $post->post_author;
    $aname = get_the_author_meta('display_name', $aid);
    $subject = 'Safety Portal: ' . $post->post_title;
    $message = $post->post_title . ' - <a href="' . get_permalink($post->ID) . '">View</a> | <a href="' . get_edit_post_link($post->ID) . '">Edit</a><br><br>By ' . $aname;
    wp_mail( get_option('admin_email'), $subject, $message )
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get name of user (not necessary the original author) editing the post’ is closed to new replies.