mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 14:13:46 +09:00
- fixed fields validation based on field's privacy settings;
This commit is contained in:
@@ -366,12 +366,15 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
*/
|
||||
$this->post_form = apply_filters( 'um_submit_post_form', $_POST );
|
||||
|
||||
if ( isset( $this->post_form[ UM()->honeypot ] ) && $this->post_form[ UM()->honeypot ] != '' ) {
|
||||
wp_die( __( 'Hello, spam bot!', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
$this->post_form = $this->beautify( $this->post_form );
|
||||
$this->post_form['submitted'] = $this->post_form;
|
||||
|
||||
$this->form_data = UM()->query()->post_data( $this->form_id );
|
||||
|
||||
$this->post_form['submitted'] = $this->post_form;
|
||||
|
||||
$this->post_form = array_merge( $this->form_data, $this->post_form );
|
||||
|
||||
// Remove role from post_form at first if role ! empty and there aren't custom fields with role name
|
||||
@@ -438,10 +441,6 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
|
||||
}
|
||||
|
||||
if ( isset( $_POST[ UM()->honeypot ] ) && $_POST[ UM()->honeypot ] != '' ) {
|
||||
wp_die( __( 'Hello, spam bot!', 'ultimate-member' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
@@ -518,18 +517,19 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
|
||||
/**
|
||||
* Beautify form data
|
||||
*
|
||||
* @param array $form
|
||||
* @return array $form
|
||||
*/
|
||||
function beautify( $form ){
|
||||
function beautify( $form ) {
|
||||
|
||||
if (isset($form['form_id'])){
|
||||
if ( isset( $form['form_id'] ) ) {
|
||||
|
||||
$this->form_suffix = '-' . $form['form_id'];
|
||||
|
||||
$this->processing = $form['form_id'];
|
||||
|
||||
foreach( $form as $key => $value ){
|
||||
foreach ( $form as $key => $value ) {
|
||||
if ( strstr( $key, $this->form_suffix ) ) {
|
||||
$a_key = str_replace( $this->form_suffix, '', $key );
|
||||
$form[ $a_key ] = $value;
|
||||
|
||||
Reference in New Issue
Block a user