Using the ACF date picker to serve as a 'birthday' user profile field. Id like to have a simple range filter using the age converted 'number' to sort through the 'birthday' user fields.
I know I can do something like this to display it on a page but not sure how to get this into a filter.
<?php $date = get_field('date_of_birth'); $birthday = new DateTime($date); $interval = $birthday->diff(new DateTime); echo $interval->y.' years old'; ?>
Not really sure where to begin on this.