mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-06-05 15:09:37 +09:00
- added fix for options if they contains spaces in the start and the end of option (added trim);
This commit is contained in:
@@ -951,7 +951,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Builder' ) ) {
|
||||
|
||||
<input type="hidden" name="_position" id="_position" value="<?php echo $metabox->edit_array['position']; ?>" />
|
||||
|
||||
<?php if ( isset( $args['mce_content'] ) ) { ?><div class="dynamic-mce-content"><?php echo $metabox->edit_array['content']; ?></div><?php } ?>
|
||||
<?php if ( isset( $args['mce_content'] ) ) { ?>
|
||||
<div class="dynamic-mce-content"><?php echo ! empty( $metabox->edit_array['content'] ) ? $metabox->edit_array['content'] : ''; ?></div>
|
||||
<?php } ?>
|
||||
|
||||
<?php $this->modal_header(); ?>
|
||||
|
||||
|
||||
@@ -609,11 +609,11 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) {
|
||||
|
||||
if ( $attrs['metakey'] != 'online_status' ) {
|
||||
if ( $attrs['metakey'] != 'role_select' && $attrs['metakey'] != 'mycred_rank' && empty( $custom_dropdown ) ) {
|
||||
$attrs['options'] = array_intersect( array_map( 'stripslashes', $attrs['options'] ), $values_array );
|
||||
$attrs['options'] = array_intersect( array_map( 'stripslashes', array_map( 'trim', $attrs['options'] ) ), $values_array );
|
||||
} elseif ( ! empty( $custom_dropdown ) ) {
|
||||
$attrs['options'] = array_intersect_key( $attrs['options'], array_flip( $values_array ) );
|
||||
$attrs['options'] = array_intersect_key( array_map( 'trim', $attrs['options'] ), array_flip( $values_array ) );
|
||||
} else {
|
||||
$attrs['options'] = array_intersect_key( $attrs['options'], array_flip( $values_array ) );
|
||||
$attrs['options'] = array_intersect_key( array_map( 'trim', $attrs['options'] ), array_flip( $values_array ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -709,14 +709,14 @@ function um_profile_field_filter_xss_validation( $value, $data, $type = '' ) {
|
||||
}
|
||||
}
|
||||
} elseif ( 'select' == $type || 'radio' == $type ) {
|
||||
if ( ! empty( $data['options'] ) && ! in_array( $value, $data['options'] ) && empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
if ( ! empty( $data['options'] ) && ! in_array( $value, array_map( 'trim', $data['options'] ) ) && empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
$value = '';
|
||||
}
|
||||
}
|
||||
} elseif ( ! empty( $value ) && is_array( $value ) ) {
|
||||
if ( 'multiselect' == $type || 'checkbox' == $type ) {
|
||||
if ( ! empty( $data['options'] ) && empty( $data['custom_dropdown_options_source'] ) ) {
|
||||
$value = array_intersect( $value, $data['options'] );
|
||||
$value = array_intersect( $value, array_map( 'trim', $data['options'] ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
|
||||
* To learn more about version 2.1 please see this [topic](https://wordpress.org/support/topic/version-2-1-4/)
|
||||
* UM2.1+ is a significant update to the Member Directories' code base from 2.0.x. Please make sure you take a full-site backup with restore point before updating the plugin
|
||||
|
||||
= 2.1.3: January 20, 2020 =
|
||||
= 2.1.3: January 21, 2020 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user