• Resolved wesmed

    (@wesmed)


    Hello,

    I am trying to modify the field label text of the UM user profiles. When someone is viewing a user’s profile, I would like the labels of several fields to say “XYZ” instead of “ABC”. It’s also important to note that the profile field labels are custom fields, not any of the pre-defined UM fields. I tried using the um_edit_label_{$key} filter hook but that didn’t change the labels. Thanks to anyone that can help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @wesmed

    Have you tried editing the field label in wp-admin> Ultimate Member> Forms> Edit your Profile Form>Edit your Custom Field? You can edit the Label of your field in the Edit Field. Here are some screenshots for reference:

    https://screenbud.com/s/JBUMLjblXNb
    screenbud.com/shot/b98e198a-8a95-45a6-8d85-444b05c2eae0

    Thread Starter wesmed

    (@wesmed)

    @gelieys

    Thank you for your response. I guess my inquiry was missing a few details. I’m aware of how to edit the field label in the UM form builder, but what I’m trying to do is modify the field label text on the frontend profiles.

    For a random, simple example, say I have a question in one of my profiles that asks, “What is your favorite color?”- I would like to have the field label say “Favorite color” on the user’s profile. My reason for trying to do this is because several of my profile questions require a longer/wordier label in order to clearly ask the question. But the full question labels are making my user profile layouts jumbled and messy, and furthermore, the questions include pronouns like “you” and “your”, which reads oddly for the corresponding users. Does this make sense? Thanks in advance!

    @wesmed

    In viewing mode you can try to use this filter:

    /**
     * UM hook
     *
     * @type filter
     * @title um_view_label_{$key}
     * @description Change field label on view by field $key
     * @input_vars
     * [{"var":"$label","type":"string","desc":"Field Label"}]
     * @change_log
     * ["Since: 2.0"]
     * @usage add_filter( 'um_view_label_{$key}', 'function_name', 10, 1 );
     * @example
     * <?php
     * add_filter( 'um_view_label_{$key}', 'my_view_label', 10, 1 );
     * function my_view_label( $label ) {
     *     // your code here
     *     return $label;
     * }
     * ?>
     */
    Plugin Support andrewshu

    (@andrewshu)

    Hi @wesmed

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to modify profile field labels’ is closed to new replies.