save timestamp only if not admin

This commit is contained in:
Evan Mullins 2020-05-12 15:18:13 -04:00
parent 407f4fb7cd
commit 4b7de4da3f

View file

@ -348,9 +348,6 @@ function wasmo_update_user( $post_id ) {
wasmo_update_user_question_count();
}
// update last_save timestamp for this user
update_user_meta( $user_id, 'last_save', time() );
// increment save_count
$save_count = get_user_meta( $user_id, 'save_count', true );
if ('' === $save_count ) {
@ -358,13 +355,14 @@ function wasmo_update_user( $post_id ) {
}
$save_count = intval($save_count) + 1;
update_user_meta( $user_id, 'save_count', $save_count );
// notify email
wasmo_send_admin_email__profile_update( $user_id, $save_count );
// if user is admin
/*
$current_user = wp_get_current_user();
if ( user_can( $current_user, 'administrator' ) ) {
//only if not edited by an admin
if ( !current_user_can( 'administrator' ) ) {
// notify email
wasmo_send_admin_email__profile_update( $user_id, $save_count );
// update last_save timestamp for this user
update_user_meta( $user_id, 'last_save', time() );
/*
// if admin - check if welcome email has been sent.
$has_received_welcome = get_user_meta( $user_id, 'has_received_welcome', true );
if ( '' === $has_received_welcome ) {
@ -372,9 +370,8 @@ function wasmo_update_user( $post_id ) {
wasmo_send_user_email__belated_welcome( $user_id );
update_user_meta( $user_id, 'has_received_welcome', true );
}
return;
*/
}
*/
wp_redirect( get_author_posts_url( $user_id ), 301);