How to manipulate the "History" field on users

by rudolfbyker   Last Updated January 12, 2018 19:07 PM

In D7, to change some settings about a field instance on a user, I would do something like this:

$instance_info = field_info_instance('user', 'field_name', 'user'); // load
... // Manipulate $instance_info
field_update_instance($instance_info); // save

But if you enable field_ui and go to admin/config/people/accounts/display, there is a field named "History". However, ‌‌field_info_instance('user', 'history', 'user'); returns NULL.

If you install devel and go to devel/field/info, the field isn't listed either!

I guess this is some sort of special field. How can I manipulate it programmatically? Specifically, I want to hide it for a very specific view mode, equivalent to using the drop-down box on the following screenshot, and selecting "hidden":

enter image description here

Tags : fields users


Related Questions




Updating user fields in Drupal 7

Updated October 25, 2016 09:03 AM