Skip to:
Content
Pages
Categories
Search
Top
Bottom

Age instead Birthday


  • EvilBen
    Participant

    @evilben

    Hey Guys,

    I’ve got another question. I like to output the Age instead of the full Birthday.

    So: The User have to registrate with his full Birthday, but

    a) that birthday should not be able to be changed (importent)
    b) in the Profile the Age should be written instead of the Birthday.

    Hope you can help

Viewing 4 replies - 1 through 4 (of 4 total)

  • Venutius
    Moderator

    @venutius

    I think you’d have to write a custom profile field which retained the date of birth on edit, but displayed the age when viewed. As a first option I’d ask the developers of the few xprofile custom fields plugins if they’d consider adding it as an option.


    EvilBen
    Participant

    @evilben

    and how/where do I have to write a function like this? Writing it in PHP would be no problem i guess.


    Venutius
    Moderator

    @venutius

    It’s not something I’ve experience at but my first choice would be to take a look at an exisiting plugin doing something similar and use that as a template. Something like creating a merge of https://wordpress.org/plugins/bp-xprofile-rich-text-field/ and the bp code for creating a date field.


    Venutius
    Moderator

    @venutius

    Hi Ben,

    How did you get on with this? I’ve been playing with profile fields and I’ve come up with a solution to this, however there is a bug in BP which prevents it from working:

    https://buddypress.trac.wordpress.org/ticket/8082#ticket

    Also, in doing this I realised that it would be simpler to add this as a feature to the existing datebox that comes with BP, it already has an option to display the elapsed time and it’s not too difficult to add another option for Age:

    https://buddypress.trac.wordpress.org/ticket/8083#ticket

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar