Register nonce used same name as register form button.

This commit is contained in:
Gerhard 2014-10-21 08:50:23 +02:00
parent 9f438edfa0
commit 1c46b7324a
2 changed files with 5 additions and 2 deletions

View File

@ -856,7 +856,10 @@ class WC_Form_Handler {
* Process the registration form.
*/
public static function process_registration() {
if ( ! empty( $_POST['register'] ) && wp_verify_nonce( $_POST['register'], 'register' ) ) {
print_r( $_POST );
//die( 'Before' );
if ( ! empty( $_POST['register'] ) && wp_verify_nonce( $_POST['_wpnonce'], 'woocommerce-register' ) ) {
die( 'Passed' );
if ( 'no' === get_option( 'woocommerce_registration_generate_username' ) ) {
$_username = $_POST['username'];

View File

@ -98,7 +98,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php do_action( 'register_form' ); ?>
<p class="form-row">
<?php wp_nonce_field( 'woocommerce-register', 'register' ); ?>
<?php wp_nonce_field( 'woocommerce-register' ); ?>
<input type="submit" class="button" name="register" value="<?php _e( 'Register', 'woocommerce' ); ?>" />
</p>