Title: User can edit profile code
Last modified: May 18, 2023

---

# User can edit profile code

 *  Resolved [GregW](https://wordpress.org/support/users/gwmbox/)
 * (@gwmbox)
 * [3 years ago](https://wordpress.org/support/topic/user-can-edit-in-profile-code/)
 * 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](https://wordpress.org/support/users/gwmbox/).
    -  This topic was modified 3 years ago by [GregW](https://wordpress.org/support/users/gwmbox/).
      Reason: more info to understand the question
    -  This topic was modified 3 years ago by [GregW](https://wordpress.org/support/users/gwmbox/).

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

 *  [missveronica](https://wordpress.org/support/users/missveronicatv/)
 * (@missveronicatv)
 * [3 years ago](https://wordpress.org/support/topic/user-can-edit-in-profile-code/#post-16747216)
 * [@gwmbox](https://wordpress.org/support/users/gwmbox/)
 * You can try this code snippet
 *     ```
       if ( UM()->roles()->um_current_user_can( 'edit', um_profile_id() ) ) {
           // your DIV ....
       }
       ```
   
 *  Thread Starter [GregW](https://wordpress.org/support/users/gwmbox/)
 * (@gwmbox)
 * [3 years ago](https://wordpress.org/support/topic/user-can-edit-in-profile-code/#post-16747244)
 * 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.

 * ![](https://ps.w.org/ultimate-member/assets/icon-256x256.png?rev=3160947)
 * [Ultimate Member – User Profile, Registration, Login, Member Directory, Content Restriction & Membership Plugin](https://wordpress.org/plugins/ultimate-member/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-member/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-member/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-member/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-member/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-member/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [profile](https://wordpress.org/support/topic-tag/profile/)

 * 2 replies
 * 2 participants
 * Last reply from: [GregW](https://wordpress.org/support/users/gwmbox/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/user-can-edit-in-profile-code/#post-16747244)
 * Status: resolved