ACF User Roles Field
Adds a user role selector field to ACF in WordPress
by Jean-Philippe Fleury · github.com/jpfleury/acf-user-roles-field
★ 0stars
9release downloads
0forks
Install
The author publishes release zips, so WP-CLI can install straight from GitHub:
wp plugin install https://github.com/jpfleury/acf-user-roles-field/releases/download/1.0.4/acf-user-roles-field.zipFrom the readme
ACF User Roles Field
ACF User Roles Field is a Wordpress plugin that adds a new ACF field allowing to select user roles.
Note that this plugin doesn't manage content access. It only shows a select field with all user roles as choices.
Installation
- Download the latest version on GitHub.
- Extract the archive and copy the folder (acf-user-roles-field) to the Wordpress plugins folder (/wp-content/plugins/).
- Go to the Wordpress plugins manager on your website (your-website.ext/wp-admin/plugins.php) and enable the plugin ACF User Roles Field. Note that you can enable auto-updates.
Usage
Admin
Go to the ACF administration page (your-website.ext/wp-admin/edit.php?posttype=acf-field-group), add a new field group and choose the field User roles:
Front-end
To display the field value, the shortcode acfuserrolesfield can be used. By default, it'll look at custom fields for the current post where the shortcode is added. For example, the following shortcode:
[acfuserrolesfield name="FIELDNAME"]
is the same as this one:
[acfuserrolesfield name="FIELDNAME" type="post"]
To get the field value from another post, use the attribute id:
[acfuserrolesfield name="FIELDNAME" id="POS
Read the full README on GitHub →