Range Filter For Custom Field Date But Display As Age

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.

Help appreciated.


Category: users Time: 2016-07-31 Views: 0
Tags: users

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.118 (s). 12 q(s)