Home › Forums › Backend Issues (wp-admin) › Restrict editor ACF capability › Reply To: Restrict editor ACF capability
Hi @codynew
Thank you for the question.
You can make use of the acf/settings filter to restrict the number of people who can edit the ACF fields.
The code will look as follows:
add_filter('acf/settings/show_admin', 'my_acf_show_admin');
function my_acf_show_admin($show) {
// provide a list of usernames who can edit custom field definitions here
$admins = array(
'user_name_1', 'user_name_2'
);
// get the current user
$current_user = wp_get_current_user();
return (in_array($current_user->user_login, $admins));
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.