signup_nonce_check

函式
signup_nonce_check ( $result )
引數
  • (array) $result
    Required:
返回值
  • (array)
定義位置
相關方法
signup_nonce_fieldswp_nonce_tickwp_version_checksignup_another_blogms_site_check
引入
-
棄用
-

signup_nonce_check: 這個函式用來檢查登錄檔單的nonce(一個用於防止CSRF攻擊的唯一識別符號)的有效性。它需要一個引數–$action–這是與nonce相關的行動。

處理在signup_nonce_fields()中建立的簽名非授權。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function signup_nonce_check( $result ) {
if ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) {
return $result;
}
if ( ! wp_verify_nonce( $_POST['_signup_form'], 'signup_form_' . $_POST['signup_form_id'] ) ) {
$result['errors']->add( 'invalid_nonce', __( 'Unable to submit this form, please try again.' ) );
}
return $result;
}
function signup_nonce_check( $result ) { if ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) { return $result; } if ( ! wp_verify_nonce( $_POST['_signup_form'], 'signup_form_' . $_POST['signup_form_id'] ) ) { $result['errors']->add( 'invalid_nonce', __( 'Unable to submit this form, please try again.' ) ); } return $result; }
function signup_nonce_check( $result ) {
	if ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) {
		return $result;
	}

	if ( ! wp_verify_nonce( $_POST['_signup_form'], 'signup_form_' . $_POST['signup_form_id'] ) ) {
		$result['errors']->add( 'invalid_nonce', __( 'Unable to submit this form, please try again.' ) );
	}

	return $result;
}

常見問題

FAQs
檢視更多 >