den1sa
Forum Replies Created
-
The slider does not slide to enable a user to change the low age or high age using a iPhone.
Can i have two text boxes instead to run a filter say between age 12 to 17?
I cannot change the current wordpress theme.
Thank you.
Thank you for your response.
Do i need to use anything else to do what i want to achieve?
Will Ultimate Member allow me to search for data entered via a choices callback dropdown, if so, how?
Thanks,
Denis
Thank you, i have now entered this in my code.
Can you please confirm that the value stored is stored as a number, so I can for example filter clothing size to only show between 12 – 16 only?
- This reply was modified 2 years, 5 months ago by den1sa.
Bump. Can anyone offer any suggestions?
Hi.
Thank you for your suggestion. I am not sure I understand this. I am trying to avoid having to use a table and list the corresponding description per line. So the user sees a dropdown that looks like this.
8 – Small
10 – Small
12 – Medium
14 – Medium
16 – Largeand so on…
So i need both values to show up in the dropdown, but only the numerical value stored.
Does what you suggested achieve this? If not, is this doable?
Thanks in advance.
Denis
- This reply was modified 2 years, 5 months ago by den1sa.
Hi Aswin,
I think i didn’t explain myself very well, sorry about that.
If i provide another example thats doesn′t relate to country, i think it will be better to understand what I am asking for.
If a user clicks on the dropdown list they are presented with the following;
A value which is stored in the database and a description which is for reference only.
Value = 8
Reference = Smallso i need it to look like this …
8 – Small
10 – Small
12 – Medium
14 – Medium
16 – Large
… and so on.So when I search for clothing size, I can filter clothing size that is between 8 and 10 only for example which is why i only need the value stored.
I hope this helps to understand my requirement.
Thanks,
Denis
- This reply was modified 2 years, 5 months ago by den1sa.
I have tried this in the code, but it doesnt work.
$obj->query_args['orderby'] = array( 'wxo_featured_clause' => 'DESC', 'birth_date' => 'ASC', );
- This reply was modified 2 years, 5 months ago by den1sa.
It worked perfectly. Thank you.
However, the sort order seems to show months old, then days old. Is it possible to hard code sort by days, weeks, months and years old in that order?
- This reply was modified 2 years, 5 months ago by den1sa.
Hi ,
I think I almost cracked this one. It works if you have a person registered in each age group, so…
< 1, <2 and >=2
If i do not have a person to fit each age group the age for the >=2 shows as 52 years old.
Please help.
Thanks,
Denis
add_filter( 'um_profile_field_filter_hook__date', 'um_041921_profile_field_filter_hook__date', 89, 2 ); function um_041921_profile_field_filter_hook__date( $value, $data ) { if ( ! $value ) { return ''; } $then_ts = strtotime( $value ); $then_year = date( 'Y', $then_ts ); $age = date( 'Y' ) - $then_year; if ( strtotime( '+' . $age . ' years', $then_ts ) > current_time( 'timestamp' ) ) { $age--; } if ( $age >= 2 ) { if ( isset( $data['pretty_format'] ) && $data['pretty_format'] == 1 ) { $value = UM()->datetime()->get_age( $value ); } else { $format = empty( $data['format_custom'] ) ? $data['format'] : $data['format_custom']; $value = date_i18n( $format, strtotime( $value ) ); return $value; } } if ( $age < 1 ) { $month = date("n", strtotime( $value ) ); $datetime1 = date_create( date("Y-m-d", strtotime( $value ) ) ); $datetime2 = date_create( date("Y-m-d", current_time( 'timestamp' ) ) ); $interval = date_diff($datetime1, $datetime2); remove_filter( 'um_profile_field_filter_hook__date', 'um_profile_field_filter_hook__date', 99, 2 ); $month = $interval->format("%m") + 0; return (int)$month." "._n( 'month old', 'months old', (int)$month, 'ultimate-member' ); } if ( $age < 2 ) { $month = date("n", strtotime( $value ) ); $datetime1 = date_create( date("Y-m-d", strtotime( $value ) ) ); $datetime2 = date_create( date("Y-m-d", current_time( 'timestamp' ) ) ); $interval = date_diff($datetime1, $datetime2); remove_filter( 'um_profile_field_filter_hook__date', 'um_profile_field_filter_hook__date', 99, 2 ); $month = $interval->format("%m") + 12; return (int)$month." "._n( 'month old', 'months old', (int)$month, 'ultimate-member' ); } return $value; }
Perfect. It works. Thank you so very much.
- This reply was modified 2 years, 6 months ago by den1sa.
Can i be cheeky and ask if the users can be sorted by ‘status and date registered (dsc)’, so that ‘Review Pending’ are listed first followed by ‘Approved’, and all have a secondary sort by date registered in descending order so the newest registrations appear first?
Brilliant. Worked perfectly.
Thank you. ??
Thank you. But will it be so that if i approve a user that is in-between multiple pending review users, i will then get the following?
pending review
pending review
approved
pending review
pending review
pending review
approved
approved
approved…I dont see the option for Not verified accounts first.
- This reply was modified 2 years, 6 months ago by den1sa.
I have found that you can set default sort users by ‘Other (Custom Field) and set the meta key to ‘account_status’. That sorts it in ascending order, but how do I change the order to descending order so that the pending_review appears first?