Users: Pass the current `WP_User_Query` instance to `found_users_query` filter.
Props spacedmonkey. Fixes #43679. Built from https://develop.svn.wordpress.org/trunk@43660 git-svn-id: http://core.svn.wordpress.org/trunk@43489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
06b2e1776c
commit
664f73e490
|
@ -600,17 +600,21 @@ class WP_User_Query {
|
||||||
$this->results = $wpdb->get_col( $this->request );
|
$this->results = $wpdb->get_col( $this->request );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.
|
|
||||||
*
|
|
||||||
* @since 3.2.0
|
|
||||||
*
|
|
||||||
* @global wpdb $wpdb WordPress database abstraction object.
|
|
||||||
*
|
|
||||||
* @param string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query.
|
|
||||||
*/
|
|
||||||
if ( isset( $qv['count_total'] ) && $qv['count_total'] ) {
|
if ( isset( $qv['count_total'] ) && $qv['count_total'] ) {
|
||||||
$this->total_users = (int) $wpdb->get_var( apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()' ) );
|
/**
|
||||||
|
* Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.
|
||||||
|
*
|
||||||
|
* @since 3.2.0
|
||||||
|
* @since 4.9.9 Added the `$this` parameter.
|
||||||
|
*
|
||||||
|
* @global wpdb $wpdb WordPress database abstraction object.
|
||||||
|
*
|
||||||
|
* @param string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query.
|
||||||
|
* @param WP_User_Query $this The current WP_User_Query instance.
|
||||||
|
*/
|
||||||
|
$found_users_query = apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()', $this );
|
||||||
|
|
||||||
|
$this->total_users = (int) $wpdb->get_var( $found_users_query );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $this->results ) {
|
if ( ! $this->results ) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-43659';
|
$wp_version = '5.0-alpha-43660';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue