Created
June 15, 2022 09:42
-
-
Save champsupertramp/2f68b8cf74f5c83244ab3d2e1184c6f9 to your computer and use it in GitHub Desktop.
Ultimate Member - Display Profiles with Today's Birthdays in the Member Directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter("um_prepare_user_query_args","um_061522_show_todays_birthdays", 10, 2 ); | |
function um_061522_show_todays_birthdays( $query_args, $directory_data ){ | |
$directory_id = $directory_data['form_id']; | |
if( 320 !== $directory_id ) return $query_args; | |
$query_args['meta_query'][ ] = array( | |
'key' => 'birth_date', | |
'value' => date("/m/d"), | |
'compare' => 'RLIKE' | |
); | |
$query_args['orderby'] = array( | |
'first_name' => 'ASC', | |
); | |
return $query_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code doesn't work, it's confusing people