{"id":35048280,"url":"https://github.com/jpfleury/acf-user-roles-field","last_synced_at":"2026-04-24T00:35:23.964Z","repository":{"id":294769959,"uuid":"988028593","full_name":"jpfleury/acf-user-roles-field","owner":"jpfleury","description":"Adds a user role selector field to ACF in WordPress","archived":false,"fork":false,"pushed_at":"2025-05-25T06:19:01.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-28T23:05:38.823Z","etag":null,"topics":["acf","acf-addon","acf-field","php","user-role","user-roles","wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jpfleury.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-22T00:28:01.000Z","updated_at":"2025-05-25T06:18:49.000Z","dependencies_parsed_at":"2025-05-22T01:22:49.349Z","dependency_job_id":"0acf14d2-f80a-4310-9e74-1a6d40d5a8f5","html_url":"https://github.com/jpfleury/acf-user-roles-field","commit_stats":null,"previous_names":["jpfleury/acf-user-roles-field"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jpfleury/acf-user-roles-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-user-roles-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-user-roles-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-user-roles-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-user-roles-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpfleury","download_url":"https://codeload.github.com/jpfleury/acf-user-roles-field/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpfleury%2Facf-user-roles-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32204710,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T00:06:41.111Z","status":"ssl_error","status_checked_at":"2026-04-24T00:06:35.224Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acf","acf-addon","acf-field","php","user-role","user-roles","wordpress","wordpress-plugin"],"created_at":"2025-12-27T09:02:46.473Z","updated_at":"2026-04-24T00:35:23.959Z","avatar_url":"https://github.com/jpfleury.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![release.yml](https://github.com/jpfleury/acf-user-roles-field/actions/workflows/release.yml/badge.svg)](https://github.com/jpfleury/acf-user-roles-field/releases)\n\n# ACF User Roles Field\n\nACF User Roles Field is a Wordpress plugin that adds a new ACF field allowing to select user roles.\n\nNote that this plugin doesn't manage content access. It only shows a select field with all user roles as choices.\n\n## Installation\n\n- Download the [latest version on GitHub](https://github.com/jpfleury/acf-user-roles-field/releases/latest/download/acf-user-roles-field.zip).\n\n- Extract the archive and copy the folder (`acf-user-roles-field`) to the Wordpress plugins folder (`/wp-content/plugins/`).\n\n- 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.\n\n## Usage\n\n### Admin\n\nGo to the ACF administration page (`your-website.ext/wp-admin/edit.php?post_type=acf-field-group`), add a new field group and choose the field **User roles**:\n\n### Front-end\n\nTo display the field value, the shortcode `acf_user_roles_field` 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:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\"]\n\nis the same as this one:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\" type=\"post\"]\n\nTo get the field value from another post, use the attribute `id`:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\" id=\"POST_ID\"]\n\nIf the field is linked to a user, set the type `user` in the shortcode. By default, it'll look at custom fields for the current user:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\" type=\"user\"]\n\nTo specify a specific user, set the attribute `id`:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\" type=\"user\" id=\"USER_ID\"]\n\nBy default, user roles are displayed as an HTML list. Example:\n\n```html\n\u003cul\u003e\n\t\u003cli\u003eAuthor\u003c/li\u003e\n\t\u003cli\u003eSubscriber\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nTo display them as a simple text list, the attribute `separator` can be set. Example:\n\n\t[acf_user_roles_field name=\"FIELD_NAME\" separator=\", \"]\n\nUser roles will be displayed as follows:\n\n\tAuthor, Subscriber\n\n### Hooks for developers\n\nThe following filter hook is available:\n\n- `acf_user_roles_field_html`: filter allowing to manipulate the HTML code before it's displayed\n\nFor example, to display the user roles with an ordered list, use the filter in your `functions.php` theme file as follows:\n\n```php\nfunction user_roles_in_ordered_list($html, $user_roles, $atts) {\n\treturn str_replace(\n\t\t['\u003cul ', '\u003c/ul\u003e'],\n\t\t['\u003col ', '\u003c/ol\u003e'],\n\t\t$html\n\t);\n}\nadd_filter('acf_user_roles_field_html', 'user_roles_in_ordered_list', 10, 3);\n```\n\nHere's another way:\n\n```php\nfunction user_roles_in_ordered_list($html, $user_roles, $atts) {\n\t$custom_html = '\u003col\u003e';\n\t\n\tforeach ($user_roles as $user_role) {\n\t\t$custom_html .= '\u003cli\u003e' . $user_role . '\u003c/li\u003e';\n\t}\n\t\n\t$custom_html .= '\u003c/ol\u003e';\n\t\n\treturn $custom_html;\n}\nadd_filter('acf_user_roles_field_html', 'user_roles_in_ordered_list', 10, 3);\n```\n\n## License\n\nACF User Roles Field: Wordpress plugin adding a new ACF field to select user roles  \nCopyright (C) 2023-2024  Jean-Philippe Fleury\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\n### Third-party code\n\n- ACF User Roles Field uses [Plugin Update Checker](https://github.com/YahnisElsts/plugin-update-checker) under the [MIT License](https://github.com/YahnisElsts/plugin-update-checker/blob/master/license.txt) in order to manage auto-updates in the Wordpress plugins manager.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpfleury%2Facf-user-roles-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpfleury%2Facf-user-roles-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpfleury%2Facf-user-roles-field/lists"}