- added some localized strings;

- fixed the lack of registration user process with empty email or username;
This commit is contained in:
nikitasinelnikov
2019-10-17 21:44:11 +03:00
parent 72ae461c6e
commit 6e7eee89bf
8 changed files with 38 additions and 24 deletions
+7 -6
View File
@@ -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;