Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#35705 closed enhancement (fixed)

Provide an "Edit user" link after adding a new user to a site or network

Reported by: jeremyfelt's profile jeremyfelt Owned by: jeremyfelt's profile jeremyfelt
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Users Keywords: has-patch needs-testing
Focuses: administration, multisite Cc:

Description

In both wp-admin/user-new.php and wp-admin/network/user-new.php, when a new user is added the confirmation message shows only that—"User added."

To aid in workflows attached to creating users, we should provide a link to edit the new user, similar to what we do when creating new sites—"Site added. Visit Dashboard or Edit Site"

In wp-admin/user-new.php, the link should go to wp-admin/user-edit.php.
In wp-admin/network/user-new.php, the link should go to wp-admin/network/user-edit.php.

Attachments (7)

35705.diff (4.3 KB) - added by codex-m 9 years ago.
Patch
35705_refreshed.diff (4.3 KB) - added by codex-m 9 years ago.
Refreshed version of the patch
35705_refreshed2.diff (4.5 KB) - added by codex-m 9 years ago.
Refreshed version with improved white space usage
35705.2.diff (4.0 KB) - added by jeremyfelt 9 years ago.
35705.3.diff (4.8 KB) - added by jeremyfelt 9 years ago.
35705.4.diff (5.2 KB) - added by jeremyfelt 9 years ago.
35705.i18n.diff (1.4 KB) - added by ramiy 9 years ago.

Download all attachments as: .zip

Change History (29)

#1 @ericlewis
9 years ago

  • Keywords good-first-bug added

This would be great. Adding good-first-bug since this sounds straight-forward.

#2 @jeremyfelt
9 years ago

  • Milestone changed from Future Release to 4.5

@codex-m
9 years ago

Patch

#3 @codex-m
9 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Hi @jeremyfelt / @ericlewis I agree this is a user-friendly feature to add. I wrote a patch (35705.diff - attached) for this and thoroughly tested in my local. Works for both network, sub-sites and even single site add user scenarios. It shows a link after adding a new user , allowing to edit the user easily.

See attached sample screenshot.

http://i.imgur.com/1oLEJyB.jpg

http://i.imgur.com/Z5bUgrD.jpg

Thanks :)

#4 @chriscct7
9 years ago

  • Keywords good-first-bug removed

#5 @chriscct7
9 years ago

  • Owner set to chriscct7
  • Status changed from new to reviewing

#6 @ocean90
9 years ago

  • Keywords needs-refresh added

@codex-m: The patch doesn't confirm with our coding standards. Can you give it a refresh please?

This ticket was mentioned in Slack in #core by jorbin. View the logs.


9 years ago

#8 @jorbin
9 years ago

  • Milestone changed from 4.5 to Future Release

The beta 1 deadline for 4.5 is tomorrow, which means no new enhancements can go in after that. Punting from 4.5

@codex-m
9 years ago

Refreshed version of the patch

#9 @codex-m
9 years ago

  • Keywords needs-refresh removed

@ocean90 / @jorbin Thanks! I attached a refreshed version of the patch based on latest SVN copy. Please review :)

#10 @jorbin
9 years ago

  • Keywords needs-refresh added

@codex-m thanks for refereshing it, but much of @ocean90's statement about coding standards hold true, especially as it relates to white space usage.

@codex-m
9 years ago

Refreshed version with improved white space usage

#11 @codex-m
9 years ago

  • Keywords needs-refresh removed

Thanks @jorbin Yep my mistake.(first time here) I attached the patch with improve space usage. Cheers.

#12 @codex-m
9 years ago

Any chance this enhancement will be available in 4.5? We are managing a multi-site with several users added/edited on a daily basis. We find this new feature very useful. Thank you :)

#13 @jeremyfelt
9 years ago

  • Milestone changed from Future Release to 4.5
  • Owner changed from chriscct7 to jeremyfelt

Taking a look at this now, hopefully before I lose LTE signal. :)

@jeremyfelt
9 years ago

#15 @jeremyfelt
9 years ago

35705.2.diff continues @codex-m's approach.

The Edit User link works as expected. However, the "Back to Users" link on the Edit User page is now confusing if you land there via Add User instead of the Users list table.

We may be able to just remove the "Back to Users" text if the referer is the Add Users page.

@jeremyfelt
9 years ago

#16 @jeremyfelt
9 years ago

35705.3.diff checks the referrer and only shows "Back to Users" if user-new.php is not part of the string.

@jeremyfelt
9 years ago

#17 @jeremyfelt
9 years ago

35705.4.diff checks for a WP_Error after wpmu_activate_signup and at least doesn't attempt to pass an invalid user ID in the referer. This isn't perfect, but our handling of it currently is not perfect either. We need to take a bigger look at all of this one day.

This ticket was mentioned in Slack in #core by mike. View the logs.


9 years ago

#19 @jeremyfelt
9 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 36695:

Multisite: Provide an "Edit user" link after adding a new user

Props codex-m, jeremyfelt.
Fixes #35705.

#20 @ocean90
9 years ago

In 36697:

I18N: Fix placeholders and add translator comments after [36695].

See #35705.

@ramiy
9 years ago

#21 @ramiy
9 years ago

@ocean90 see the attached patch. Simpler strings without placeholders, and without HTML tags in translation strings.

#22 @ocean90
9 years ago

@ramiy Same story as #35746.

Note: See TracTickets for help on using tickets.