Title: Editing users (edits wrong user)
Last modified: August 22, 2016

---

# Editing users (edits wrong user)

 *  [stowelly](https://wordpress.org/support/users/stowelly/)
 * (@stowelly)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/)
 * Hi, Just started using this plugin, and it seems that when you edit a user in
   the backend (i.e to validate via admin) it applies the edit to a different users
   id, making them both the same user, essentially permanently disabling their account.
   Was going to have a look into the issue but couldnt find a github for this project.
   thanks
 * [https://wordpress.org/plugins/front-end-only-users/](https://wordpress.org/plugins/front-end-only-users/)

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

 *  Plugin Author [Rustaurius](https://wordpress.org/support/users/rustaurius/)
 * (@rustaurius)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474867)
 * Hi Stowelly,
 * Is it possible that you were logged in on front-end while editing a user in the
   WordPress admin area?
 *  Thread Starter [stowelly](https://wordpress.org/support/users/stowelly/)
 * (@stowelly)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474873)
 * Just tried reproducing it logged in and out…. and yes you are correct, editing
   the user while logged in does infact cause you to edit the wrong user.
 * do you think this might be a simple fix?
 *  Thread Starter [stowelly](https://wordpress.org/support/users/stowelly/)
 * (@stowelly)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474875)
 * just to clarify, when not logged into the front end it works correctly
 *  [Doru Tirlea](https://wordpress.org/support/users/stkwarrior/)
 * (@stkwarrior)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474950)
 * Hello guys.
 * This problem is caused by the line of code on line 17 from file “Prepare_Data_For_Insertion.
   php” where we have this check
    “`if ($User_ID == "" and is_admin())`“.
 * When you are logged in as user in front end and in the same time (on the same
   browser) in admin, then for sure $User_ID is not empty as it takes the logged
   in user from cookie so it will skip that line and it won’t know that it’s actually
   the admin page.
 * The fix is simple as you just need to change the lines from
    `if ($User_ID ==""
   and is_admin())` to `if( is_admin() )`
 * and the rest should still work fine as far as I tested.
 * Let me know if this helps you Rustaurius for the next release or if not, stowelly
   maybe you can make a quick fix yourself in the plugin until the next version 
   with this issue fixed.
 *  Plugin Contributor [etoilewebdesign](https://wordpress.org/support/users/etoilewebdesign/)
 * (@etoilewebdesign)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474953)
 * Hi StKWarrior,
 * Thanks for pointing that out and suggesting the fix.
    We’ll look into implementing
   a fix in the next version. In the meantime, hope that helps stowelly.

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

The topic ‘Editing users (edits wrong user)’ is closed to new replies.

 * ![](https://ps.w.org/front-end-only-users/assets/icon-128x128.png?rev=1805921)
 * [Front End Users](https://wordpress.org/plugins/front-end-only-users/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/front-end-only-users/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/front-end-only-users/)
 * [Active Topics](https://wordpress.org/support/plugin/front-end-only-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/front-end-only-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/front-end-only-users/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [etoilewebdesign](https://wordpress.org/support/users/etoilewebdesign/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/editing-users-edits-wrong-user/#post-5474953)
 * Status: not resolved