Skip to content

Commit ba047c4

Browse files
committed
Return new user id after registration submit handler
1 parent ce72481 commit ba047c4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

includes/wpum-forms/class-wpum-form-registration.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ public function submit( $atts ) {
483483
/**
484484
* Process the registration form.
485485
*
486-
* @return void
486+
* @return int|false
487487
*/
488488
public function submit_handler() {
489489

@@ -494,11 +494,11 @@ public function submit_handler() {
494494
$values = $this->get_posted_fields();
495495

496496
if ( ! wp_verify_nonce( $_POST['registration_nonce'], 'verify_registration_form' ) ) {
497-
return;
497+
return false;
498498
}
499499

500500
if ( empty( $_POST['submit_registration'] ) ) {
501-
return;
501+
return false;
502502
}
503503

504504
if ( is_wp_error( ( $return = $this->validate_fields( $values ) ) ) ) {
@@ -588,9 +588,10 @@ public function submit_handler() {
588588

589589
} catch ( Exception $e ) {
590590
$this->add_error( $e->getMessage(), 'registration_submit' );
591-
return;
591+
return false;
592592
}
593593

594+
return $new_user_id;
594595
}
595596

596597
/**

0 commit comments

Comments
 (0)