wphooks.info - found_posts_query

found_posts_query

The hook occurs in the following file:

wp-includes/class-wp-query.php:
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
		if ( ! empty( $limits ) ) {
			/**
			 * Filters the query to run for retrieving the found posts.
			 *
			 * @since 2.1.0
			 *
			 * @param string   $found_posts The query to run to find the found posts.
			 * @param WP_Query &$this       The WP_Query instance (passed by reference).
			 */
			$this->found_posts = $wpdb->get_var( apply_filters_ref_array( 'found_posts_query', array( 'SELECT FOUND_ROWS()', &$this ) ) );
		} else {
			$this->found_posts = count( $this->posts );
		}

		/**
		 * Filters the number of found posts for the query.
		 *
		 * @since 2.1.0
		 *