Birthday / Age – UserPro Forums https://forum.userproplugin.com/forums/topic/birthday-age/feed/ Sat, 04 May 2024 13:42:09 +0000 https://bbpress.org/?v=2.6.2 en-US https://forum.userproplugin.com/forums/topic/birthday-age/#post-38212 <![CDATA[Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38212 Fri, 23 May 2014 20:19:29 +0000 Blukkie Hi,

I use now ‘date picket’ to let members fill in their birthday date.
But I want to show their ‘Age’ in numbers on the profiles. Is there a trick that they can see the age instead of the date they filled in?

Strange that there is no ‘Age’ field. Pretty important for a profile..

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38334 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38334 Sat, 24 May 2014 19:42:12 +0000 admin You can use hooks to do this task as there is no age field automatically. The logic is simple, you need to hook into the action that prepends key value e.g. convert a youtube link to video embed as used in this example

See functions/fields-hooks.php

/* Pre-value: Vimeo, YouTube */
if (strpos($value, “vimeo.com”) !== false || strpos($value, “youtube.com”) !== false ) {
if ( substr( $value, 0, 7 ) === “http://&#8221; || substr( $value, 0, 8 ) === “https://&#8221; ) {
global $wp_embed;
$post_embed = $wp_embed->run_shortcode(‘[embed height="200"]‘.$value.’[/embed]‘);
return $post_embed;
}
}

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38341 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38341 Sat, 24 May 2014 19:47:58 +0000 Blukkie Hm, I don’t rly get this..
I need to put in fields-hooks.php a code so it will convert the display to a age-number. But I don’t get this youtube example doing something like that. I assume I need to do this with a ‘date-picker’ field?

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38344 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38344 Sat, 24 May 2014 19:50:02 +0000 admin e.g. If field key == age, compute the date and find age from date, the hook usage assumes you have basic php knowledge. Do you? Did you deal with wordpress actions/hooks before?

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38345 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38345 Sat, 24 May 2014 19:52:42 +0000 Blukkie I don’t have enough php knowledge for it, no.
I thought it would be a general-code I just could use, but it seems it’s more difficult to do it.

But why is the age field here on the site but not in the script? Maybe cool to add this in some update, or not?

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38355 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38355 Sat, 24 May 2014 20:24:01 +0000 admin The age field allow user to put his age and not a datepicker that automatically transforms inputted date to age.

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38359 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38359 Sat, 24 May 2014 20:25:48 +0000 Blukkie Ah, too bad.
But thank you for the quick answers!

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-38361 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-38361 Sat, 24 May 2014 20:26:51 +0000 admin You are so welcome!

]]>
https://forum.userproplugin.com/forums/topic/birthday-age/#post-45815 <![CDATA[Reply To: Birthday / Age]]> https://forum.userproplugin.com/forums/topic/birthday-age/#post-45815 Fri, 30 Jan 2015 07:46:44 +0000 Sakthi Ganesh Can admin share the hooks for this.This is very mandatory requirement for everyone who use the software.This will save everyone

]]>