UserPro Forums
  • Create new topic
  • Forums
    • No replies topics
    • Newest topics
    • Forum statistics
  • Account
    • Lost password
    • Register
    • Login
  • Documentation
  • Back to main site

Community Forums

User To User Support Forum/Forums/Support Questions (UserPro)/Birthday / Age

Birthday / Age

Agebirthdaydate pickprofile
  • 6 years, 9 months ago AvatarBlukkie
    Participant

    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..

    6 years, 9 months ago Avataradmin
    Keymaster

    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://” || substr( $value, 0, 8 ) === “https://” ) {
    global $wp_embed;
    $post_embed = $wp_embed->run_shortcode(‘[embed height="200"]‘.$value.’[/embed]‘);
    return $post_embed;
    }
    }

    6 years, 9 months ago AvatarBlukkie
    Participant

    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?

    6 years, 9 months ago Avataradmin
    Keymaster

    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?

    6 years, 9 months ago AvatarBlukkie
    Participant

    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?

    6 years, 9 months ago Avataradmin
    Keymaster

    The age field allow user to put his age and not a datepicker that automatically transforms inputted date to age.

    6 years, 9 months ago AvatarBlukkie
    Participant

    Ah, too bad.
    But thank you for the quick answers!

    6 years, 9 months ago Avataradmin
    Keymaster

    You are so welcome!

    6 years ago AvatarSakthi Ganesh
    Participant

    Can admin share the hooks for this.This is very mandatory requirement for everyone who use the software.This will save everyone

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Disclaimer

This forum is 100% free and USER to USER support only. Technical support staff doesn’t monitor this forum actively.

If you are a customer and want to get technical support from our staff please submit a technical support ticket here: UserPRO Technical Support

Recent Topics

  • How Does Outsourcing Help a Business?
  • MBBS in China, Study MBBS in China, MBBS China Fees 2021
  • Kunming Medical University – Study MBBS from China
  • Multiple edit forms
  • Escort service in Nainital Call at 8171380882| 24*7 Available

About forum

Here you can find help from UserPro plugin developers and other UserPro fellow users. Please be polite and ask your questions. NO SPAM!

Search Forums

Follow us

  • facebook
  • twitter
  • youtube
© Copyright UserPro