mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- added some localized strings;
- fixed the lack of registration user process with empty email or username;
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
// Exit if accessed directly
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
if ( ! class_exists( 'um\core\Register' ) ) {
|
||||
|
||||
|
||||
@@ -18,8 +19,8 @@ if ( ! class_exists( 'um\core\Register' ) ) {
|
||||
* Register constructor.
|
||||
*/
|
||||
function __construct() {
|
||||
add_action( "um_after_register_fields", array( $this, 'add_nonce' ) );
|
||||
add_action( "um_submit_form_register", array( $this, 'verify_nonce' ), 1, 1 );
|
||||
add_action( 'um_after_register_fields', array( $this, 'add_nonce' ) );
|
||||
add_action( 'um_submit_form_register', array( $this, 'verify_nonce' ), 1, 1 );
|
||||
}
|
||||
|
||||
|
||||
@@ -60,14 +61,14 @@ if ( ! class_exists( 'um\core\Register' ) ) {
|
||||
* }
|
||||
* ?>
|
||||
*/
|
||||
$allow_nonce_verification = apply_filters( "um_register_allow_nonce_verification", true );
|
||||
$allow_nonce_verification = apply_filters( 'um_register_allow_nonce_verification', true );
|
||||
|
||||
if( ! $allow_nonce_verification ){
|
||||
if ( ! $allow_nonce_verification ) {
|
||||
return $args;
|
||||
}
|
||||
|
||||
if ( ! wp_verify_nonce( $args['_wpnonce'], 'um_register_form' ) || empty( $args['_wpnonce'] ) || ! isset( $args['_wpnonce'] ) ) {
|
||||
wp_die('Invalid Nonce.');
|
||||
wp_die( __( 'Invalid Nonce.', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
return $args;
|
||||
|
||||
Reference in New Issue
Block a user