Support

Account

Home Forums Backend Issues (wp-admin) Not allowing users with the editor role to select themselves in user field Reply To: Not allowing users with the editor role to select themselves in user field

  • There is an undocumented hook for the user field

    
    acf/fields/user/query
    acf/fields/user/query/name={$field_name}
    acf/fields/user/query/key={$field_key}
    

    This works just like the same hook for a relationship field that is documented here https://www.advancedcustomfields.com/resources/acf-fields-relationship-query/.

    The arguments are those for the WP get_users() function https://codex.wordpress.org/Function_Reference/get_users, you can set the “exclude” argument to the current user and that should remove them from the list.