acf_get_pretty_user_roles()
acf_get_pretty_user_roles
description
Хуков нет.
Возвращает
$post_id. (int)
Использование
acf_get_pretty_user_roles( $allowed );
- $allowed
- .
По умолчанию:false
Список изменений
| С версии 5.3.2 | Введена. |
Код acf_get_pretty_user_roles() acf get pretty user roles ACF 6.4.2
function acf_get_pretty_user_roles( $allowed = false ) {
// vars
$editable_roles = get_editable_roles();
$allowed = acf_get_array( $allowed );
$roles = array();
// loop
foreach ( $editable_roles as $role_name => $role_details ) {
// bail early if not allowed
if ( ! empty( $allowed ) && ! in_array( $role_name, $allowed ) ) {
continue;
}
// append
$roles[ $role_name ] = translate_user_role( $role_details['name'] );
}
// return
return $roles;
}