plugin updates
This commit is contained in:
@@ -141,13 +141,14 @@ if ( ! class_exists( 'ACF_Ajax_Query_Users' ) ) :
|
||||
// Determine if more results exist.
|
||||
// As this query does not return grouped results, the calculation can be exact (">").
|
||||
$this->more = ( $total_users > count( $users ) + $args['offset'] );
|
||||
|
||||
// Otherwise, group results via role.
|
||||
} else {
|
||||
|
||||
// Unset args that will interfer with query results.
|
||||
unset( $args['role__in'], $args['role__not_in'] );
|
||||
|
||||
$args['search'] = $this->search ? $this->search : '';
|
||||
|
||||
// Loop over each role.
|
||||
foreach ( $roles as $role => $role_label ) {
|
||||
|
||||
|
||||
@@ -93,6 +93,12 @@ if ( ! class_exists( 'ACF_Ajax_Query' ) ) :
|
||||
$this->search = sanitize_text_field( $request['search'] );
|
||||
$this->is_search = true;
|
||||
}
|
||||
|
||||
if ( isset( $request['s'] ) && acf_not_empty( $request['s'] ) ) {
|
||||
$this->search = sanitize_text_field( $request['s'] );
|
||||
$this->is_search = true;
|
||||
}
|
||||
|
||||
if ( isset( $request['post_id'] ) ) {
|
||||
$this->post_id = $request['post_id'];
|
||||
}
|
||||
@@ -115,18 +121,19 @@ if ( ! class_exists( 'ACF_Ajax_Query' ) ) :
|
||||
if ( isset( $request['query'] ) ) {
|
||||
return (array) $request['query'];
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* get_items
|
||||
* get_results
|
||||
*
|
||||
* Returns an array of results for the given args.
|
||||
*
|
||||
* @date 31/7/18
|
||||
* @since 5.7.2
|
||||
*
|
||||
* @param array args The query args.
|
||||
* @param array $args The query args.
|
||||
* @return array
|
||||
*/
|
||||
function get_results( $args ) {
|
||||
@@ -134,7 +141,7 @@ if ( ! class_exists( 'ACF_Ajax_Query' ) ) :
|
||||
}
|
||||
|
||||
/**
|
||||
* get_item
|
||||
* get_result
|
||||
*
|
||||
* Returns a single result for the given item object.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user