• If I want to add the user_registered date from the wp_users table to the profile display how would I go about adding that? Pulling from the db is okay but should I be using some hook to display the data or editing a profile template?

    I see there is a um_after_form_fields hook, but things that I put in there are also displayed on the login form where as I only want it on the profile form. Is there a different hook I should be using?

    https://www.ads-software.com/plugins/ultimate-member/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wpuzer

    (@wpuzer)

    Looks like I can use the hooks in ultimate-member\templates\profile.php

    Such as um_profile_header and um_profile_content_main_default

    Those get me pretty close. Built-in fields go inside

    <div class="um-row _um_row_1 " style="margin: 0 0 30px 0;">
    <div class="um-col-1">

    The hooks insert stuff outside of that as far as I can tell, but still I think close enough to do what I need.

    Now I need to avoid showing the field when the profile is in edit mode.

    Thread Starter wpuzer

    (@wpuzer)

    I see that I can check um_is_on_edit_profile() to know if profile is in edit mode or not.

    This is how I’m adding a field now:

    function my_add_registration_date()
    {
    ?>
    <?php if(!um_is_on_edit_profile()): ?>
    <div class="um-field um-field-user_registered um-field-text"
         data-key="user_registered">
        <div class="um-field-label">
            <label for="user_registered">Registration Date</label>
            <div class="um-clear"></div>
        </div>
        <div class="um-field-area">
        <?php echo date('F j, Y', my_get_registered_date()); ?>
        </div>
    </div>
    <?php endif; ?>
    <?php
    }
    
    add_action('um_profile_content_main_default', 'my_add_registration_date');

    So mostly my issue is resolved although if there’s a cleaner way to integrate this let me know.

    Plugin Author Ultimate Member

    (@ultimatemember)

    Thanks for sharing with community ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Adding extra html to profile?’ is closed to new replies.