ACF_Field_User::ajax_query_result
Filters the AJAX Query result.
Method of the class: ACF_Field_User{}
Hooks from the method
Returns
array.
Usage
$ACF_Field_User = new ACF_Field_User(); $ACF_Field_User->ajax_query_result( $item, $user, $query );
- $item(array) (required)
- The choice id and text.
- $user(WP_User) (required)
- The user object.
- $query(ACF_Ajax_Query) (required)
- The query object.
Changelog
| Since 5.8.8 | Introduced. |
ACF_Field_User::ajax_query_result() ACF Field User::ajax query result code ACF 6.8.8
function ajax_query_result( $item, $user, $query ) {
/**
* Filters the result text.
*
* @date 21/5/19
* @since 5.8.1
*
* @param string The result text.
* @param WP_User $user The user object.
* @param array $field The ACF field related to this query.
* @param (int|string) $post_id The post_id being edited.
*/
$item['text'] = apply_filters( 'acf/fields/user/result', $item['text'], $user, $query->field, $query->post_id );
return $item;
}