Hide Year from Birthdate
-
I chose your Birthdate Field. Then I chose custom format to be j M , as you can see here– https://prnt.sc/TT5odaEC8Rmj
I chose the Custom Format of j M because my users want their Birth Year hidden.
Unfortunately, it still shows the Full Year, as you can seen here– https://prnt.sc/XJTbkT5-dlba
Whereas, on the Single User Page, it shows correctly as expected. See it here–
Is there any help you can do for me, so that the predefined Birthdate Field will show only Day and Month, while the Year will stay hidden?
Regards.
-
You can try this code snippet for your birth day format issue.
add_filter( "um_profile_field_filter_hook__birth_date", 'um_profile_field_filter_hook__birth_date_custom', 10, 2 ); function um_profile_field_filter_hook__birth_date_custom( $value, $data ) { if ( ! empty( $value )) { $value = date_i18n( 'j M', strtotime( $value ) ); remove_filter( 'um_profile_field_filter_hook__date', 'um_profile_field_filter_hook__date', 99, 2 ); } return $value; }Install the code snippet into your active theme’s
functions.phpfile
or use the “Code Snippets” plugin.@missveronicatv
Hello Miss Veronica,
I Thank you very much for the code. It worked well, and I really appreciate.
Heaven Bless your soul 🥰
2.) Now, I’ve had this issue with Ultimate Member, that I haven’t found any solution to it.
I’ve even dropped it on Stack Overflow as you can see here– https://stackoverflow.com/questions/77575953/make-small-adjustments-to-ultimate-member-birthday-snippet?noredirect=1#comment136762791_77575953
The problem is:
If you go here– https://docs.ultimatemember.com/article/1765-send-birthday-greetings-to-accounts-with-today-s-birthdays
You will see that it’s a Code snippet by Ultimate Member Team, intended to send Birthday Greetings to Members of the website whose Membership features are powered by Ultimate Member plugin.
I just have 2 challenges with the code:
1.) I need to adjust the code in such a way that it will send the Birthday Greetings by 6am in the morning.
Would you be able to help with this?
2.) The code is throwing an error on line 38, as you can see here– https://prnt.sc/EhUIRnX4LBUi
This looks like a hint on the error– https://prnt.sc/y_T65FU4JYXo
You have any idea how to fix this?
Regards.6am in the morning
Your current testing first, code will execute at once when the code is correct then hourly.
After testing finished you can sethourlytodailyand a time value of next day at 06.2.) The code is throwing an error on line 38
Change line 35 to
$wp_user_query = new WP_User_Query( $query_args );2.) The code is throwing an error on line 38
Your code did actually fix the issue. Thanks.
For question One(1), I’m still lost. I didn’t understand anything of what you said at all.
Can you just write the updated code that will make it send the message by 6am, and send it to me?
Regards.
You can change line 67 to
wp_schedule_event( strtotime( '2023-12-02 06:00:00' ), 'daily', 'um_do2_birthday_greet_notification' );I think the code now looks correct. I really appreciate all your efforts.
Unfortunately, these code things can sometimes act funny.
Everything looks alright, code-wise.
But when I add Email content, as you can see here– https://prnt.sc/mS2iWCAK2Uhd
And then I save, all the Email content vanishes, as you can see here– https://prnt.sc/0PoS0D7wLZQM
Any idea on what could be causing this?
I’m not surprised at all.
This code snippet has never been tested by the UM developer
with these bugs you have discovered.You can look at this “Birthday Emails” plugin.
The plugin should be easy to integrate with UM if you are interested.Thanks for all your efforts and help.
The Happy Birthday plugin only works for WordPress and BuddyPress.
Now, WordPress doesn’t have Happy Birthday Field, and my Birthday Field isn’t provided by BuddyPress but Ultimate Member.
It means that plugin wouldn’t work with my website’s Set up.
Considering that you are this good with Ultimate Member code, could you take that Birthday Code Snippet from Ultimate Member and try debug it from your end, to find out what’s wrong with it?
Regards.
Remove the UM code snippet and their plugin version of the code snippet.
Install the “Birthday Emails” plugin.https://ww.wp.xz.cn/plugins/birthday-emails/#description
You can try this new plugin now “Birthday emails integration”.
Test by making an User Registration and “Birthday emails”
will display the day/month in WP Backend when editing the User.
Try to send a test email to yourself.Later I will add also when User is updating the birth date from Profile page.
missveronica @missveronicatv)
I would be silly, if I don’t appreciate all your help and efforts.
Now, while it is clear that I will remove the Birthday Code Snippet of Ultimate Member, I cannot install the Birthday Emails plugin because:
1.) It has No Support, and WordPress is already complaining about it, as you can see here– https://prnt.sc/-6clXKjs4S4W
On the Support Forum, I have asked, if the Author no longer supports the plugin, and that was 6 days ago. See it here– https://prnt.sc/QuBfZ7Of_AmB
Then there has been support questions that have not been answered since 2 Years ago. See it here– https://prnt.sc/fHI_2cYbhtKo
With these reasons, I don’t think I will install that plugin, and there’s every likelihood that it will soon be abandonware.
2.) I’ve tried using AutomatorWP (https://ww.wp.xz.cn/plugins/automatorwp) — and it can actually send Emails.
I’m wondering if you can configure this AutomatorWP plugin to actually send Birthday Emails, then show me how you did it?
3.) I wish you know BuddyPress as good as you know Ultimate Member. I would have used BuddyPress instead of Ultimate Member.
I chose Ultimate Member because of simplicity, and because I could add Profile fields to the Member cards on the frontend. I mean this– https://prnt.sc/PDyaj9A2Y9a8
But with BuddyPress, I haven’t yet found a way to do it.
Would you try to also know how to customize BuddyPress?
Regards.1. I understand your comments.
2. No
3. NoHi @gamicord
This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.
Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂
Regards
The topic ‘Hide Year from Birthdate’ is closed to new replies.