Filter hook 'found_users_query'

in WP Core File wp-includes/class-wp-user-query.php at line 859

View Source

found_users_query

Filter Hook
Description
Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.

Hook Information

File Location wp-includes/class-wp-user-query.php View on GitHub
Hook Type Filter
Line Number 859

Hook Parameters

Type Name Description
string $sql The SELECT FOUND_ROWS() query for the current WP_User_Query.
WP_User_Query $query The current WP_User_Query instance.

Usage Examples

Basic Usage
<?php
// Hook into found_users_query
add_filter('found_users_query', 'my_custom_filter', 10, 2);

function my_custom_filter($sql, $query) {
    // Your custom filtering logic here
    return $sql;
}

Source Code Context

wp-includes/class-wp-user-query.php:859 - How this hook is used in WordPress core
<?php
 854  					 * @global wpdb $wpdb WordPress database abstraction object.
 855  					 *
 856  					 * @param string        $sql   The SELECT FOUND_ROWS() query for the current WP_User_Query.
 857  					 * @param WP_User_Query $query The current WP_User_Query instance.
 858  					 */
 859  					$found_users_query = apply_filters( 'found_users_query', 'SELECT FOUND_ROWS()', $this );
 860  
 861  					$this->total_users = (int) $wpdb->get_var( $found_users_query );
 862  				}
 863  
 864  				if ( $qv['cache_results'] ) {

PHP Documentation

<?php
/**
					 * Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.
					 *
					 * @since 3.2.0
					 * @since 5.1.0 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 $query The current WP_User_Query instance.
					 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-user-query.php
Related Hooks

Related hooks will be displayed here in future updates.