Skip to main content
ACFWordPress

WP Editors to have access to Adv Custom Fields

By October 13, 2017No Comments

The ACF menu only shows to admin users by default. To display the ACF ‘Custom Fields’ menu to other WP roles you’ll need to use the ‘acf/settings/capability’ filter.

‘acf/settings/capability’ filter

This allows you to customize the ‘capability’ needed to show the ACF ‘Custom Fields’ menu item (not the options page feature).

The value of this ‘capability’ setting is used to register the ACF menu item via the add_menu_page() function.

Add the code below to your functions file to show the ACF menu for editors. Use the WordPress Roles and Capabilities Codex page to work out which capability to use.

Editors (and above) can edit_pages, authors can’t.

 

Allow Editors to Create Custom Fields

// Allow editors to use ACF
function my_acf_settings_capability( $capability ) {
    return 'edit_pages';
}
add_filter('acf/settings/capability', __NAMESPACE__ . '\\my_acf_settings_capability');

I hope that helps. The namespace part of the code is used by WordPress sites built with Sage.

The ACF menu should now appear for editors.

ACF menu

Andrew Taylor

A senior UI designer with over 25 years of web design and web development experience working for some of the largest companies in the UK. An expert in all things Magento and WordPress.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.