Home › Forums › ACF PRO › Change User Select Text › Reply To: Change User Select Text
In ACF5 there is a new filter in the user field that can be used to alter what is displayed, which is not documented. acf/fields/user/result
.
You can see them at line 304 of /fields/user.php
// filters
$result = apply_filters("acf/fields/user/result", $result, $user, $field, $post_id);
$result = apply_filters("acf/fields/user/result/name={$field['_name']}", $result, $user, $field, $post_id);
$result = apply_filters("acf/fields/user/result/key={$field['key']}", $result, $user, $field, $post_id);
$result
=> value to be displayed ie, user name
$user
=> the user object
$field
=> the field object
$post_id
=> the current post id
add_fitler('', 'change_user_display', 10, 4);
function change_user_display($result, $user, $field, $post_id) {
// change $result to what you want displayed
return $result;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.