• Resolved melchi2

    (@melchi2)


    Hello,

    I have a problem with the age filter on the member directory the slider does not indicate the age but only minimum and maximum. Surprisingly when I use it the age appears in the URL of the web browser.

    I checked

    Age: {min_range} – {max_range} years old
    Age: {value} years old

    And here

    /**
    		 * @param $filter
    		 *
    		 * @return mixed
    		 */
    		function slider_range_placeholder( $filter, $attrs ) {
    			switch ( $filter ) {
    				default: {
    					$label = ! empty( $attrs['label'] ) ? $attrs['label'] : $filter;
    					$label = ucwords( str_replace( array( 'um_', '_' ), array( '', ' ' ), $label ) );
    					$placeholders = apply_filters( 'um_member_directory_filter_slider_range_placeholder', false, $filter );
    
    					if ( ! $placeholders ) {
    						switch ( $attrs['type'] ) {
    							default:
    								$placeholders = array(
    									"<strong>$label:</strong>&nbsp;{value}",
    									"<strong>$label:</strong>&nbsp;{min_range} - {max_range}",
    								);
    								break;
    							case 'rating':
    								$placeholders = array(
    									"<strong>$label:</strong>&nbsp;{value}" . __( ' stars', 'ultimate-member' ),
    									"<strong>$label:</strong>&nbsp;{min_range} - {max_range}" . __( ' stars', 'ultimate-member' )
    								);
    								break;
    						}
    					}
    
    					break;
    				}
    				case 'birth_date': {
    					$placeholders = array(
    						__( '<strong>Age:</strong>&nbsp;{value} years old', 'ultimate-member' ),
    						__( '<strong>Age:</strong>&nbsp;{min_range} - {max_range} years old', 'ultimate-member' )
    					);
    					break;
    				}
    			}
    
    			return $placeholders;
    		}

    I found a workaround by creating a field where users simply indicate their age, but I would like to know if you have a script based on the year of registration to add more 1 years to the age indicated

    Thanks for help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter melchi2

    (@melchi2)

    Hello,
    
    I was able to solve the problem of the malfunction of the date picker due to a bad translation string.
    On the other hand I don't understand when I clone it in the form, if I go to the filter in the directory, instead of having a range slider, I have two blocks. If I click on it I have a calendar, which is not practical
    
    https://mega.nz/file/bd4S2DSS#Bu19XJCN3FCXlNrAmoi3QSTJKgupUxAE8_RQFKrilyo
    
    Would you have a solution?
    Thread Starter melchi2

    (@melchi2)

    resolved

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘date picker range slider’ is closed to new replies.