Making WordPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#1950 closed defect (bug) (fixed)

Add support for custom titles on support forums

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: coffee2code's profile coffee2code
Milestone: Priority: normal
Component: Support Forums Keywords: has-patch commit
Cc:

Description

After the upgrade to bbPress 2.x, there's no longer a way to give someone a custom title.

Attachments (2)

meta-1950.patch (2.3 KB) - added by SergeyBiryukov 8 years ago.
meta-1950.2.patch (1.8 KB) - added by netweb 8 years ago.

Download all attachments as: .zip

Change History (19)

This ticket was mentioned in Slack in #forums by sergey. View the logs.


8 years ago

#2 @netweb
8 years ago

Related: #1972

This ticket was mentioned in Slack in #forums by sergey. View the logs.


8 years ago

This ticket was mentioned in Slack in #forums by sergey. View the logs.


8 years ago

#5 @SergeyBiryukov
8 years ago

  • Keywords has-patch added

meta-1950.patch adds a Custom Title input (only available to moderators) to user's profile.

#6 @SergeyBiryukov
8 years ago

  • Keywords commit added

@netweb
8 years ago

#7 @netweb
8 years ago

Patch meta-1950.2.patch levages bbPress built in support of WordPress' wp_get_user_contact_methods()

See also: https://codex.wordpress.org/Plugin_API/Filter_Reference/user_contactmethods

#8 follow-up: @netweb
8 years ago

Related: #1975

Patch https://meta.trac.wordpress.org/attachment/ticket/1975/1975.2.diff adds the 3 legacy contact fields that should be removed aim, yim, and jabber, commit 1975.2.diff and resolve both tickets at the same time, or meta-1950.2.patch and then refresh #1975's.

#9 in reply to: ↑ 8 ; follow-up: @SergeyBiryukov
8 years ago

Replying to netweb:

commit 1975.2.diff and resolve both tickets at the same time, or meta-1950.2.patch and then refresh #1975's.

Tested 1975.2.diff on a local install.

Not sure if Custom Title belongs to the Contact Info section, I think it's more related to display name, that's why I put it under Name.

Looks good to me otherwise :)

Version 0, edited 8 years ago by SergeyBiryukov (next)

#10 in reply to: ↑ 9 @netweb
8 years ago

Replying to SergeyBiryukov:

Replying to netweb:

commit 1975.2.diff and resolve both tickets at the same time, or meta-1950.2.patch and then refresh #1975's.

Tested 1975.2.diff on a local install.

Not sure if Custom Title belongs in the Contact Info section, I think it's more related to display name, that's why I put it under Name.

Looks good to me otherwise :)

bbPress processes all the custom contact methods here, setting and unsetting as needed, via:

We can copy the form-user-edit.php template to the wporg-forums theme, moving this up to the "Name" section, it would also serve as a very quick way to add support for "moderator notes" to be added to user profiles in the same section.

This ticket was mentioned in Slack in #forums by yui. View the logs.


8 years ago

#12 @coffee2code
8 years ago

  • Owner set to coffee2code
  • Resolution set to fixed
  • Status changed from new to closed

In 4142:

Support Forums: Add support for custom titles.

Restores input for field previously available under bbPress 1.x. Custom titles are already displayed when set. The field is only available to those who can moderate.

Props SergeyBiryukov.
Fixes #1950.

#13 follow-up: @coffee2code
8 years ago

I applied meta-1950.patch as the current approach for this. However, bbp_displayed_user_field() doesn't reliably show the custom title, so I had to get it more directly via get_user_option(). I haven't investigated this too much yet.

@netweb: I like the simplicity of leveraging wp_get_user_contact_methods() for adding and handling the field for the custom title from your patch, but it's unsemantic as the custom title isn't a contact method. Maybe if there was an identical but generic way for dealing with additional user fields?

I also agree with @SergeyBiryukov in that the custom title shouldn't fall under "Contact Info", though "Name" isn't a perfect fit either.

After #1972, "Contact Info" will be left having only "Website" as a field, so further reorganization of the profile edit form may be warranted eventually.

Replying to netweb:

We can copy the form-user-edit.php template to the wporg-forums theme, moving this up to the "Name" section, it would also serve as a very quick way to add support for "moderator notes" to be added to user profiles in the same section.

Please propose this in a separate ticket if you still want to explore it.

#14 follow-up: @SergeyBiryukov
8 years ago

Thanks @coffee2code!

There's still no way to give someone a custom title though, I can only edit my own. Should I reopen the ticket, or will we handle this in #1985?

#15 in reply to: ↑ 14 @Clorith
8 years ago

Replying to SergeyBiryukov:

There's still no way to give someone a custom title though, I can only edit my own. Should I reopen the ticket, or will we handle this in #1985?

I think that should fall in naturally with #1985, as it should be the same edit screen just for a different user.

#16 in reply to: ↑ 13 ; follow-up: @netweb
8 years ago

Replying to coffee2code:

I applied meta-1950.patch as the current approach for this. However, bbp_displayed_user_field() doesn't reliably show the custom title, so I had to get it more directly via get_user_option(). I haven't investigated this too much yet.

Looks like bbp_sanitize_displayed_user_field() might be the cause here in not playing well with other user custom options, will need more investigation.

@netweb: I like the simplicity of leveraging wp_get_user_contact_methods() for adding and handling the field for the custom title from your patch, but it's unsemantic as the custom title isn't a contact method. Maybe if there was an identical but generic way for dealing with additional user fields?

Sounds good :+1, maybe in WP core, available for any plugin or theme to extend?

I also agree with @SergeyBiryukov in that the custom title shouldn't fall under "Contact Info", though "Name" isn't a perfect fit either.

Cool, that was where bbp_displayed_user_field() put them all ;)

#17 in reply to: ↑ 16 @netweb
8 years ago

Replying to netweb:

Replying to coffee2code:

@netweb: I like the simplicity of leveraging wp_get_user_contact_methods() for adding and handling the field for the custom title from your patch, but it's unsemantic as the custom title isn't a contact method. Maybe if there was an identical but generic way for dealing with additional user fields?

Sounds good :+1, maybe in WP core, available for any plugin or theme to extend?

Just wanted to also note that the functionality of wp_get_user_contact_methods() automatically displays, removes, adds input form fields including saving the user option to applicable sections of back end user profiles https://example.com/wp-admin/profile.php and https://example.com/wp-admin/user-edit.php?user_id=3 and front end user profiles http://wporg-forums.dev/support/users/username/ and user profile edit profiles http://wporg-forums.dev/support/users/username/edit

Note: See TracTickets for help on using tickets.