CMB2
CMB2 copied to clipboard
Easily position fields in user profile
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?
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.
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.
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.