Ticket #12295 (reviewing enhancement)

Opened 2 years ago

Last modified 5 months ago

More support to customize user profile edit page

Reported by: pampfelimetten Owned by: nacin
Priority: normal Milestone: Future Release
Component: Users Version: 3.0
Severity: normal Keywords: has-patch needs-testing dev-feedback
Cc: dragunoff@…, Viruthagiri

Description

Right now I can edit the contact methods via the user_contactmethods filter, but I can not modify or remove the Personal Options or the Name Options. I want to keep the interface as simple as possible for my users, and I don't think that they need to edit this settings at all. If wp wants to be a cms, it should give me control over this aspect as well. At least, give me custom css-ids, so I can remove it via css!

Attachments

user-edit.php.diff Download (6.3 KB) - added by pampfelimetten 2 years ago.
12295.002.diff Download (2.7 KB) - added by pampfelimetten 2 years ago.
12295.002.2.diff Download (2.7 KB) - added by pampfelimetten 2 years ago.
12295.003.diff Download (11.4 KB) - added by pampfelimetten 2 years ago.
First Cut, missing only the about yourself section
12295.004.diff Download (12.1 KB) - added by pampfelimetten 2 years ago.
Updated to latest trunk
12295.005.diff Download (13.4 KB) - added by pampfelimetten 2 years ago.
Updated to latest trunk
12295.006.diff Download (10.9 KB) - added by pampfelimetten 15 months ago.
Update to latest trunk
12295.diff Download (13.1 KB) - added by JohnONolan 8 months ago.
Updated patch to latest trunk + more IDs

Change History

  • Keywords has-patch, needs-testing added; wp-admin, user profile, cms, edit removed
  • Owner set to nacin
  • Status changed from new to reviewing

After wds-brad2 suggested to write a css based patch, here it is. I'm no expert with the backend-styles, so please give me a hint, if I have used a wrong naming scheme.

Code works fine for me, with the following test-css you can hide and unhide every single option:

#form-table-personal-options-title,
#form-table-personal-options-admin-color-scheme,
#form-table-personal-options-visual-editor,
#form-table-personal-options-keyboard-shortcuts,
#form-table-name-title,
#form-table-name-user-login,
#form-table-name-first-name,
#form-table-name-last-name,
#form-table-name-nickname,
#form-table-name-display-name,
#form-table-contact-info-title,
#form-table-contact-info-email,
#form-table-contact-info-url,
#form-table-about-yourself-title,
#form-table-about-yourself-description
{
	display:none !important;
}

With the following test-css you can hide each section:

#form-table-personal-options,
#form-table-name,
#form-table-contact-info,
#form-table-about-yourself,
#form-table-caps
{
	display:none !important;
}

The password table row already got an ID, so I didn't touch it.

Feedback very welcome!

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

CSS isn't really the way to go here. I think we should abstract it out with filters and default actions, similar to contact methods and the idea in #6837.

  • Owner nacin deleted

Thanks for the Info, thats what I thought at the beginning as well, but I think this is beyond my skills. Anybody else wants to look into this?

  • Milestone changed from 3.0 to Future Release

First Cut, missing only the about yourself section

  • Keywords has-patch needs-testing added; needs-patch removed
  • Owner set to nacin
  • Version set to 3.0
  • Milestone changed from Future Release to 3.1

please ignore the 12295.002* diff files. In the 12295.003.diff I abstracted it with filters and functions, you can now enable and disable every field (expect for the last "about-yourself" section, i ran out of time for that). One open question though: I skipped the class "code" for url field (why is it there anyway?)

And: How to add the disabled function for username? Should I make every function like the "personal options" section, with multidimensional arrays?

Please give me feedback!

Updated to latest trunk

Updated to latest trunk

  • Milestone changed from Awaiting Triage to Future Release

Update to latest trunk

Updated patch to latest trunk + more IDs

  • Keywords dev-feedback added
  • Severity changed from major to normal

I think this is pretty comprehensive now - only sense-check question I had was, is changing #password to #profile-about-password a problem? I don't think any JS hooks into it, can't find any core CSS targeting it.

One more thing that should be accounted for:

Sometimes plugins add fields to user profiles (eg. After The Deadline and WordPress SEO) - these should be wrapped with divs with unique IDs based on the plugin name so that they can be styled differently or hidden depending on requirements. At present they cannot be targeted in any way at all other than some very unstable :nth-child hackery, which is a small but not insignificant problem.

Hi John, thanks for updating the patch, I just tested against the latest trunk and it works fine. It would be great if we could get it in 3.4 early!

  • Cc dragunoff@… added
  • Cc Viruthagiri added
  • Version changed from 3.0 to 3.3

Sorry. I'm new to core trac. Can i use this patch? Or should i wait until 3.4 release?

  • Version changed from 3.3 to 3.0
Note: See TracTickets for help on using tickets.