-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Issues 1384 #1836
WIP: Issues 1384 #1836
Conversation
Showing message when user login in from givewp form that s/he has successfully login to the sites
Add JS to closed the message box after 5 second
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raftaar1191 I like the way you implement it. I added following suggestions, Please check them.
includes/process-donation.php
Outdated
@@ -230,7 +236,18 @@ function give_process_form_login() { | |||
give_log_user_in( $user_data['user_id'], $user_data['user_login'], $user_data['user_pass'] ); | |||
|
|||
if ( $is_ajax ) { | |||
echo 'success'; | |||
$data['status'] = 'success'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raftaar1191 Can you use WordPress core function https://codex.wordpress.org/Function_Reference/wp_send_json_success
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Commit id: raftaar1191@41bf6bf
includes/process-donation.php
Outdated
@@ -219,7 +220,12 @@ function give_process_form_login() { | |||
* | |||
* @since 1.0 | |||
*/ | |||
do_action( 'give_ajax_donation_errors' ); | |||
ob_start(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raftaar1191 Can we use WordPress core function?
https://codex.wordpress.org/Function_Reference/wp_send_json_error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Commit id: raftaar1191@41bf6bf
includes/process-donation.php
Outdated
sprintf( | ||
/* translators: %s: user first name */ | ||
esc_html__( 'Welcome %s! You have successfully logged into your account.', 'give' ), | ||
$user_data['user_first'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raftaar1191 user_first
can be empty , so show user_login
in that situation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Commit id: raftaar1191@41bf6bf
Code refactor as per WP standard
includes/process-donation.php
Outdated
sprintf( | ||
/* translators: %s: user first name */ | ||
esc_html__( 'Welcome %s! You have successfully logged into your account.', 'give' ), | ||
( isset( $user_data['user_first'] ) && ! empty( $user_data['user_first'] ) ) ? $user_data['user_first'] : $user_data['user_login'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@raftaar1191 Do not use isset
, empty will check for both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DevinWalker You can review it. Working fine for me.
This works well. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well
Description
This PR is for #1384
How Has This Been Tested?
Tested this with for Donations, Donors, Log Requests.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: