BuddyDev

Search

Xprofile Character Limit

  • Participant
    Level: Initiated
    Posts: 11
    Joy on #51694

    Hi Brajesh,

    I’m using the BuddyPress Xprofile Custom Field Types plugin. When using a text field, is there a way to limit characters? Thank you.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #51697

    Hi Joy,
    Thank you for the question.

    Our plugin does not offer any limit/restrictions of xprofile fields. It adds new field types.

    You can use BuddyPress Advance Xprofile field plugin to achieve your goal.

    https://wordpress.org/plugins/advanced-xprofile-fields-for-buddypress/

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    Joy on #51751

    Thank you for your response. It doesn’t look like that plugin is supported anymore – forum posts suggests that the character limit is not working either.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #51758

    Hi Joy,
    I am sorry to hear about that. We may provide some code but it will need you to specify field ids, will that be fine?

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 11
    Joy on #51767

    That would be wonderful!!

  • Participant
    Level: Master
    Posts: 153
    Talia B on #51788

    we are also intrested in that limit char for long time! can you pls share?

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #51813

    Thank you both of you.

    We will put the code in next 2 days.

    Regards
    Brajesh

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #51824

    Hello Joy,

    Please try the code I have put it in a GitHub gist. Please refer to the following URL:

    https://gist.github.com/raviousprime/89346dad536031d8d7c056219e958880

    and let me know if it helps or not.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 11
    Joy on #51828

    Wow, thank you so much for working on that! However, it’s actually words limit – I was looking for character limit. Can this be adjusted please?

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #51830

    Hello Joy,

    This code offers character limits instead of word limits in code I have used words in place of character. Please it a try and let me know if it works or not.

    Note: Please change field IDs and threshold values in the function ‘buddydev_get_words_threshold_value’ as per your site.

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved