mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-20 15:13:55 +09:00
- fixed integration with User Tags extension (remove some hardcode, changed to hooks);
- fixed 2.0 upgrades for User roles meta data; - clear/review code;
This commit is contained in:
@@ -79,15 +79,8 @@ if ( ! class_exists( 'Members' ) ) {
|
||||
// additional filter for search field attributes
|
||||
$attrs = apply_filters("um_search_field_{$filter}", $attrs);
|
||||
|
||||
if ( UM()->builtin()->is_dropdown_field( $filter, $attrs ) ) {
|
||||
$type = 'select';
|
||||
} else if ( 'user_tags' == $attrs['type'] ) {
|
||||
$attrs['options'] = apply_filters('um_multiselect_options_user_tags', array(), $attrs);
|
||||
$attrs['custom'] = 1;
|
||||
$type = 'select';
|
||||
} else {
|
||||
$type = 'text';
|
||||
}
|
||||
$type = UM()->builtin()->is_dropdown_field( $filter, $attrs ) ? 'select' : 'text';
|
||||
$type = apply_filters( 'um_search_field_type', $type, $attrs );
|
||||
|
||||
// filter all search fields
|
||||
$attrs = apply_filters( 'um_search_fields', $attrs );
|
||||
|
||||
@@ -203,14 +203,12 @@ function um_submit_account_errors_hook( $args ) {
|
||||
$url = UM()->permalinks()->get_current_url( true );
|
||||
$url = add_query_arg( 'updated', 'account', $url );
|
||||
|
||||
UM()->redirect( $url );
|
||||
exit;
|
||||
um_js_redirect( $url );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UM()->redirect( $url );
|
||||
exit;
|
||||
um_js_redirect( $url );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -220,10 +220,6 @@
|
||||
UM()->form()->add_error($key, sprintf(__('%s is required.','ultimate-member'), $array['title'] ) );
|
||||
}
|
||||
|
||||
if ( defined('um_user_tags_path') && isset( $array['type'] ) && $array['type'] == 'user_tags' && isset( $array['required'] ) && $array['required'] == 1 && !isset( $args[$key] ) ) {
|
||||
UM()->form()->add_error($key, sprintf(__('%s is required.','ultimate-member'), $array['title'] ) );
|
||||
}
|
||||
|
||||
if ( isset( $array['type'] ) && $array['type'] == 'radio' && isset( $array['required'] ) && $array['required'] == 1 && !isset( $args[$key] ) && !in_array($key, array('role_radio','role_select') ) ) {
|
||||
UM()->form()->add_error($key, sprintf(__('%s is required.','ultimate-member'), $array['title'] ) );
|
||||
}
|
||||
@@ -238,6 +234,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
do_action( 'um_add_error_on_form_submit_validation', $array, $key, $args );
|
||||
|
||||
if ( isset( $args[$key] ) ) {
|
||||
|
||||
if ( isset( $array['required'] ) && $array['required'] == 1 ) {
|
||||
|
||||
Reference in New Issue
Block a user