fix label in show_filter if if not set in custom fields

This commit is contained in:
andrewshuba
2019-02-20 13:41:47 +02:00
parent 4b154dd650
commit 2f52e7163e
+6 -1
View File
@@ -246,9 +246,14 @@ if ( ! class_exists( 'um\core\Members' ) ) {
/*if( isset($attrs) && is_array( $attrs['options'] ) ){
asort( $attrs['options'] );
}*/
if( isset( $attrs['label'] ) ){
$label = $attrs['label'];
} else {
$label = $attrs['title'];
}
?>
<select name="<?php echo $filter; ?>" id="<?php echo $filter; ?>" class="um-s1" style="width: 100%" data-placeholder="<?php echo __( stripslashes( $attrs['label'] ), 'ultimate-member' ); ?>" <?php if ( ! empty( $attrs['custom_dropdown_options_source'] ) ) { ?> data-um-parent="<?php echo $attrs['parent_dropdown_relationship']; ?>" data-mebers-directory="yes" data-um-ajax-source="<?php echo $attrs['custom_dropdown_options_source'] ?>"<?php } ?>>
<select name="<?php echo $filter; ?>" id="<?php echo $filter; ?>" class="um-s1" style="width: 100%" data-placeholder="<?php echo __( stripslashes( $label ), 'ultimate-member' ); ?>" <?php if ( ! empty( $attrs['custom_dropdown_options_source'] ) ) { ?> data-um-parent="<?php echo $attrs['parent_dropdown_relationship']; ?>" data-mebers-directory="yes" data-um-ajax-source="<?php echo $attrs['custom_dropdown_options_source'] ?>"<?php } ?>>
<option></option>