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;