ACF User Role Field Setting Wordpress Plugin - Rating, Reviews, Demo & Download
Plugin Description
Warning: Support for Sub Fields Removed as of Version 4.0.0
This is an add on plugin for Advanced Custom Fields (ACF) Version 5.
This plugin will not provide any functionality if ACF5 is not installed.
This plugin adds a field setting to all field types so that user roles allowed to edit the field can
be selected. Only those roles selected for the field will be able to edit the field.
Github Repository
This plugin is also on GitHub
https://github.com/Hube2/acf-user-role-field-setting
Excluded Field Types
Most of the time it would not make sense for a tab field, unless all of the fields in the tab were set the same, in other words, removing a tab should remove all the fields in that tab. That’s not something that I can do at this point.
I’m not sure about the clone field, I haven’t worked with it much. You can test it out if you want.
I have also removed support for repeater, group and flexible content fields because I cannot preserver the values of these fields if they are not editable in the ACF interface. Please note that I do not know what the effect of allowing user role settings on these fields will be.
There is a filter so that you can adjust the types of fields that are excluded. Here is an example
<?php
add_filter('acf/user_role_setting/exclude_field_types', 'user_role_setting_excluded_field_types');
function user_role_setting_excluded_field_types($exclude) {
/*
$exclude holds an array of field types to exclude from adding user role settings
default value:
$exclude = array('tab' => 'tab', 'clone' => 'clone');
*/
// remove tab field from exclude
if (isset($exclude['tab'])) {
unset($exclude['tab']);
}
// add message field to exclude
$exclude['message'] = 'message';
return $exclude;
}
?>