• Resolved GregW

    (@gwmbox)


    I am needing to load a specific div that is displayed on a profile but can only be seen by the person that can edit that profile.

    I note in the members-grid.php there is a code

    if ( user.can_edit )

    However that does not work on the profile.php file I have edited quite a lot.

    Is there some code I can use in the profile.php file to only show a div if they can edit the profile they are viewing?

    • This topic was modified 3 years ago by GregW.
    • This topic was modified 3 years ago by GregW. Reason: more info to understand the question
    • This topic was modified 3 years ago by GregW.
Viewing 2 replies - 1 through 2 (of 2 total)
  • missveronica

    (@missveronicatv)

    @gwmbox

    You can try this code snippet

    if ( UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) {
        // your DIV ....
    }
    Thread Starter GregW

    (@gwmbox)

    Worked perfectly, I really appreciate your help

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

The topic ‘User can edit profile code’ is closed to new replies.