mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
- reviewed #1298;
- temporarily removed Stripe from extensions; - wpcs for extensions.php;
This commit is contained in:
@@ -499,73 +499,100 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
update_option( 'um_fields', $all_fields );
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate aria errors attributes.
|
||||
*
|
||||
* @param bool $is_error
|
||||
* @param string $field_id
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function aria_valid_attributes( $is_error, $field_id, $context = 'error' ) {
|
||||
//$context
|
||||
$attr = ' aria-invalid="false" ';
|
||||
if ( $is_error ) {
|
||||
if ( 'notice' === $context ) {
|
||||
$errormessage_id = 'um-notice-for-' . $field_id;
|
||||
} else {
|
||||
$errormessage_id = 'um-error-for-' . $field_id;
|
||||
}
|
||||
$attr = ' aria-invalid="true" aria-errormessage="' . esc_attr( $errormessage_id ) . '" ';
|
||||
}
|
||||
return $attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print field error
|
||||
* Print field error.
|
||||
*
|
||||
* @since 2.6.12 Added $input_id attribute.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $input_id
|
||||
* @param bool $force_show
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function field_error( $text, $force_show = false ) {
|
||||
|
||||
public function field_error( $text, $input_id, $force_show = false ) {
|
||||
if ( empty( $text ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$error_id = 'um-error-for-' . $input_id;
|
||||
|
||||
if ( $force_show ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
|
||||
if ( ! UM()->form()->processing ) {
|
||||
$output = '<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-error" id="' . esc_attr( $error_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print field notice
|
||||
* Print field notice.
|
||||
*
|
||||
* @since 2.6.12 Added $input_id attribute.
|
||||
*
|
||||
* @param string $text
|
||||
* @param string $input_id
|
||||
* @param bool $force_show
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function field_notice( $text, $force_show = false ) {
|
||||
|
||||
public function field_notice( $text, $input_id, $force_show = false ) {
|
||||
if ( empty( $text ) ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$notice_id = 'um-notice-for-' . $input_id;
|
||||
|
||||
if ( $force_show ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
if ( isset( $this->set_id ) && UM()->form()->processing === $this->set_id ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
} else {
|
||||
$output = '';
|
||||
}
|
||||
|
||||
if ( ! UM()->form()->processing ) {
|
||||
$output = '<div class="um-field-notice"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
$output = '<div class="um-field-notice" id="' . esc_attr( $notice_id ) . '"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>' . wp_kses( $text, UM()->get_allowed_html( 'templates' ) ) . '</div>';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if field has a server-side error
|
||||
*
|
||||
@@ -2353,7 +2380,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
@@ -2362,9 +2389,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2387,7 +2414,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' autocomplete="' . esc_attr( $autocomplete ) . '" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' autocomplete="' . esc_attr( $autocomplete ) . '" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
@@ -2396,9 +2423,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2428,14 +2455,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="number" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $number_limit . ' />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="number" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $number_limit . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2464,20 +2491,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2502,20 +2529,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2550,20 +2577,20 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password">
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>
|
||||
<span class="um-toggle-password"><i class="um-icon-eye"></i></span>
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2604,17 +2631,17 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( UM()->options()->get( 'toggle_password' ) ) {
|
||||
$output .= '<div class="um-field-area-password"><input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" /><span class="um-toggle-password"><i class="um-icon-eye"></i></span></div>';
|
||||
$output .= '<div class="um-field-area-password"><input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/><span class="um-toggle-password"><i class="um-icon-eye"></i></span></div>';
|
||||
} else {
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />';
|
||||
$output .= '<input class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $name ) . '" id="' . esc_attr( $key . $form_suffix ) . '" value="' . esc_attr( $this->field_value( $key, $default, $data ) ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $name ) . '/>';
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2638,14 +2665,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2684,14 +2711,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$disabled_weekdays = '[' . implode( ',', $data['disabled_weekdays'] ) . ']';
|
||||
}
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-range="' . esc_attr( $data['range'] ) . '" data-years="' . esc_attr( $data['years'] ) . '" data-years_x="' . esc_attr( $data['years_x'] ) . '" data-disabled_weekdays="' . esc_attr( $disabled_weekdays ) . '" data-date_min="' . esc_attr( $data['date_min'] ) . '" data-date_max="' . esc_attr( $data['date_max'] ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-value="' . esc_attr( $value ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-range="' . esc_attr( $data['range'] ) . '" data-years="' . esc_attr( $data['years'] ) . '" data-years_x="' . esc_attr( $data['years_x'] ) . '" data-disabled_weekdays="' . esc_attr( $disabled_weekdays ) . '" data-date_min="' . esc_attr( $data['date_min'] ) . '" data-date_max="' . esc_attr( $data['date_max'] ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-value="' . esc_attr( $value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2713,14 +2740,14 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-intervals="' . esc_attr( $data['intervals'] ) . '" data-value="' . esc_attr( $field_value ) . '" />
|
||||
$output .= '<input ' . $disabled . ' class="' . esc_attr( $this->get_class( $key, $data ) ) . '" type="' . esc_attr( $input ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" placeholder="' . esc_attr( $placeholder ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" data-format="' . esc_attr( $data['js_format'] ) . '" data-intervals="' . esc_attr( $data['intervals'] ) . '" data-value="' . esc_attr( $field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>
|
||||
|
||||
</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2826,7 +2853,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $data['height'] ) . ';" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '">' . esc_textarea( $textarea_field_value ) . '</textarea>';
|
||||
$output .= '<textarea ' . $disabled . ' style="height: ' . esc_attr( $data['height'] ) . ';" class="' . esc_attr( $this->get_class( $key, $data ) ) . '" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_id ) . '" placeholder="' . esc_attr( $placeholder ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '>' . esc_textarea( $textarea_field_value ) . '</textarea>';
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2836,9 +2863,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2853,13 +2880,13 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$output .= '<div class="um-field-area">';
|
||||
|
||||
$output .= '<div class="um-rating um-raty" id="' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-number="' . esc_attr( $data['number'] ) . '" data-score="' . $this->field_value( $key, $default, $data ) . '"></div>';
|
||||
$output .= '<div class="um-rating um-raty" id="' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-number="' . esc_attr( $data['number'] ) . '" data-score="' . $this->field_value( $key, $default, $data ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $key ) . '></div>';
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -2906,7 +2933,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$field_name = $key . $form_suffix;
|
||||
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" />';
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>';
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
}
|
||||
@@ -2991,9 +3018,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
/* end */
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
@@ -3005,7 +3032,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$field_name = $key . $form_suffix;
|
||||
$file_field_value = $this->field_value( $key, $default, $data );
|
||||
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $file_field_value ) . '" />';
|
||||
$output .= '<input type="hidden" name="' . esc_attr( $field_name ) . '" id="' . esc_attr( $field_name ) . '" value="' . esc_attr( $file_field_value ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '/>';
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
}
|
||||
@@ -3116,9 +3143,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
}
|
||||
/* end */
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
@@ -3335,7 +3362,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
|
||||
$field_value = '';
|
||||
|
||||
$output .= '<select data-default="' . esc_attr( $default ) . '" ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . esc_attr( $form_key ) . '" id="' . esc_attr( $field_id ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . esc_attr( $this->get_class( $key, $data, $class ) ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $atts_ajax . '>';
|
||||
$output .= '<select data-default="' . esc_attr( $default ) . '" ' . $disabled . ' ' . $select_original_option_value . ' ' . $disabled_by_parent_option . ' name="' . esc_attr( $form_key ) . '" id="' . esc_attr( $field_id ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . esc_attr( $this->get_class( $key, $data, $class ) ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $atts_ajax . ' ' . $this->aria_valid_attributes( $this->is_error( $form_key ), $form_key ) . '>';
|
||||
$output .= '<option value=""></option>';
|
||||
|
||||
// add options
|
||||
@@ -3380,9 +3407,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $form_key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $form_key ) );
|
||||
$output .= $this->field_error( $this->show_error( $form_key ), $form_key );
|
||||
} elseif ( $this->is_notice( $form_key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $form_key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $form_key ), $form_key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3417,7 +3444,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '<div class="um-field-icon"><i class="' . esc_attr( $data['icon'] ) . '"></i></div>';
|
||||
}
|
||||
|
||||
$output .= '<select ' . $disabled . ' multiple="multiple" name="' . esc_attr( $field_name ) . '[]" id="' . esc_attr( $field_id ) . '" data-maxsize="' . esc_attr( $max_selections ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '">';
|
||||
$output .= '<select ' . $disabled . ' multiple="multiple" name="' . esc_attr( $field_name ) . '[]" id="' . esc_attr( $field_id ) . '" data-maxsize="' . esc_attr( $max_selections ) . '" data-validate="' . esc_attr( $validate ) . '" data-key="' . esc_attr( $key ) . '" class="' . $this->get_class( $key, $data, $class ) . '" style="width: 100%" data-placeholder="' . esc_attr( $placeholder ) . '" ' . $this->aria_valid_attributes( $this->is_error( $key ), $field_name ) . '>';
|
||||
|
||||
if ( isset( $options ) && 'builtin' === $options ) {
|
||||
$options = UM()->builtin()->get( $data['filter'] );
|
||||
@@ -3536,9 +3563,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $field_name );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $field_name );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3591,7 +3618,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$options = apply_filters( "um_radio_field_options_{$key}", $options );
|
||||
$options = $this->get_available_roles( $form_key, $options );
|
||||
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . '>';
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $form_key ) . '>';
|
||||
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
@@ -3693,9 +3720,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $form_key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $form_key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
@@ -3745,7 +3772,7 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
*/
|
||||
$options = apply_filters( "um_checkbox_field_options_{$key}", $options );
|
||||
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . '>';
|
||||
$output .= '<div ' . $this->get_atts( $key, $classes, $conditional, $data ) . ' ' . $this->aria_valid_attributes( $this->is_error( $key ), $key ) . '>';
|
||||
|
||||
if ( isset( $data['label'] ) ) {
|
||||
$output .= $this->field_label( $data['label'], $key, $data );
|
||||
@@ -3834,9 +3861,9 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
|
||||
$output .= '</div>';
|
||||
|
||||
if ( $this->is_error( $key ) ) {
|
||||
$output .= $this->field_error( $this->show_error( $key ) );
|
||||
$output .= $this->field_error( $this->show_error( $key ), $key );
|
||||
} elseif ( $this->is_notice( $key ) ) {
|
||||
$output .= $this->field_notice( $this->show_notice( $key ) );
|
||||
$output .= $this->field_notice( $this->show_notice( $key ), $key );
|
||||
}
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
Reference in New Issue
Block a user