Thanks @elliot!
Here the snippet I used, hope it can help other ppl if are doing the same thing:
add_filter('acf/load_field/name=user_groups', 'populateUserGroups');
function populateUserGroups( $field )
{
// reset choices
$field['choices'] = array();
global $wp_roles;
$roles = $wp_roles->get_names();
foreach ($roles as $role) {
$field['choices'][ $role ] = $role;
}
return $field;
}
Hi @elliot, can I ask you how to create a hook for populating the select field? I’d assume that the best tut that explain my needs is this one: http://www.advancedcustomfields.com/resources/tutorials/dynamically-populate-a-select-fields-choices/
Is it correct?