diff --git a/includes/core/um-actions-account.php b/includes/core/um-actions-account.php index 242ff955..0017066b 100644 --- a/includes/core/um-actions-account.php +++ b/includes/core/um-actions-account.php @@ -482,6 +482,8 @@ add_action( 'um_account_pre_update_profile', 'um_disable_native_email_notificati */ add_action( 'um_after_account_privacy', 'um_after_account_privacy' ); function um_after_account_privacy( $args ) { + global $wpdb; + $user_id = get_current_user_id(); ?>
' . esc_html__( 'You could download your previous data:', 'ultimate-member' ) . '
'; + echo '' . esc_html__( 'download personal data', 'ultimate-member' ) . ''; + echo '' . esc_html__( 'You could send a new request for an export of personal your data.', 'ultimate-member' ) . '
'; + + } + + $pending = $wpdb->get_results( "SELECT ID, post_status FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'export_personal_data' AND post_status != 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); + + if ( $pending[0]['post_status'] == 'request-pending' ) { + echo '' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '
'; + } elseif ( $pending[0]['post_status'] == 'request-confirmed' ) { + echo '' . esc_html__( 'The administrator has not yet approved downloading the data. Please expect an email with a link to your data.', 'ultimate-member' ) . '
'; + } else { ?> + +' . esc_html__( 'Your personal data has been deleted.', 'ultimate-member' ) . '
'; + echo '' . esc_html__( 'You could send a new request for deleting your personal data.', 'ultimate-member' ) . '
'; + + } + + $pending = $wpdb->get_results( "SELECT ID, post_status FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'remove_personal_data' AND post_status != 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); + + if ( $pending[0]['post_status'] == 'request-pending' ) { + echo '' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '
'; + } elseif ( $pending[0]['post_status'] == 'request-confirmed' ) { + echo '' . esc_html__( 'The administrator has not yet approved deleting your data. Please expect an email with a link to your data.', 'ultimate-member' ) . '
'; + } else { ?> + + + + + +