Skip to:
Content
Pages
Categories
Search
Top
Bottom

Set default text in a multi line text area profile field


  • honoluluman
    Participant

    @honoluluman

    Hello,

    I am trying to set a default text (value) in a multi line text area profile field with field_id=5.
    Something like ‘Apparently, this user prefers to keep an air of mystery about them.’

    The user can, if he wants, just delete the text and write his own. But i am not sure if there is a bp_xprofile_field hook that i could use for that, so that the text is there by default in the first place.

    Any help would be appreciated.

Viewing 1 replies (of 1 total)

  • honoluluman
    Participant

    @honoluluman

    By something like this i have managed to set a default text-value when the field is empty after saving.

    function default_value ( $user_id ) {
        $default_text = xprofile_get_field_data( 4, $user_id );
        if (empty($default_text)) {
            xprofile_set_field_data( 4, $user_id, "Apparently, this user prefers to keep an air of mystery about them.");
        } 
    }
    
    add_action( 'xprofile_updated_profile', 'default_value');

    Which is good.

    But i need also to have the field set with the default value from the very start when the field is being created for the user.So i guess i would need to use some othen action or hook for that?

    Any help would be appreciated.

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