CMB2 icon indicating copy to clipboard operation
CMB2 copied to clipboard

Easily position fields in user profile

Open jerasokcm opened this issue 9 months ago • 3 comments

I couldn't find a way to exactly position custom fields in the user profile page. By default, custom fields added with CMB2 appear at the end of the user profile. I tried to use the "priority" parameter, but It seems not having any effect. For instance, I would like to have my fields displayed after the "Contact" section. Maybe I'm overlooking something here?

jerasokcm avatar Apr 30 '24 21:04 jerasokcm

There are only a few hooks in the user profile pages: https://github.com/WordPress/WordPress/blob/8aa7eb7e160ddf67638c6b1e890945633c0253fd/wp-admin/user-edit.php#L865-L885

If you want to create a PR to be able to hook into a different place (e.g. admin_color_scheme_picker, personal_options, profile_personal_options, wp_create_application_password_form), you're welcome to.

jtsternberg avatar Apr 30 '24 22:04 jtsternberg

Thanks for your answer. Do you imagine another way to conditionally display some user meta boxes on other locations of the profile edit page (e.g. personal options), without touching the CMB2 functionality? Best regards.

jerasokcm avatar May 19 '24 19:05 jerasokcm

This really relies on available hooks in WP core to dictate what type of things can be shown/rendered where. I suspect user pages aren't hot topics for WP core devs to work on sadly.

tw2113 avatar May 20 '24 12:05 tw2113