This is a feature request for the Types User fields.
When I create an "User field group" I would like to have the ability to decide if it has to be displayed on the add user form and/or edit form. That would be an ideal completion of the current "display by role" feature.
My need is the following: I have a user field group specific for a role, with some required fields. When I create a new user from the WP admin, I am forced to insert all the required fields, even if I am creating an user of a different role, which doesn't need these fields at all.
Thank you.
Dear Francesco,
Thanks for the feedback, as you can see, when you setup a custom user field, there is a meesage:
Conditional display is not supported for User fields.
And I put it into our to-do list as a feature request, our developers will take care of it, but there isn't any ETA for it.
Hi there,
thanks for your reply. Please note however that I was not talking about conditional user fields as currently available for custom post fields (these are conditions to decide whether a field should be displayed based on value(s) of other field(s)). I was talking about the ability to decide if the fields have to be displayed in the "new user" form and/or in the "edit user" form. This is a feature that could be useful also for custom post types (as far as I know it's not currently available), but it's particular important for users field groups, because Types actually prevents the ability to perform some operations that are normally available in native WordPress (create users with no custom fields). In these terms I think this is in between from a feature request and a bug report.
Thanks.
Thanks for the details, I add your comment into our to-do list.
Thank you.
In the meantime please could you provide a code snippet to prevent the user custom fields from being displayed/processed in the "new user" admin screen (by removing hooked functions)?
Sorry for the misunderstand, I can duplicate same problem, and I checked the source codes of Types plugin, there isn't related action/filter hooks we can use in your case, so I escalated to this thread to our 2nd tier supporters, hope they can find any workaround.
I've advised our development team on this, meanwhile you can use the hook below to fit your needs:
add_action( 'init', 'remove_types_fields_new_user' );
function remove_types_fields_new_user(){
remove_action( 'load-user-new.php', 'wpcf_usermeta_add_user_screen' );
}
Thank you! The snippet worked like a charm.