diff --git a/includes/core/class-member-directory-meta.php b/includes/core/class-member-directory-meta.php index 8460f520..dae20b37 100644 --- a/includes/core/class-member-directory-meta.php +++ b/includes/core/class-member-directory-meta.php @@ -1051,6 +1051,16 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) { $sql_where = implode( ' AND ', $this->where_clauses ); $sql_where = ! empty( $sql_where ) ? 'AND ' . $sql_where : ''; + $query = array( + 'select' => $this->select, + 'sql_where' => $sql_where, + 'having' => $this->having, + 'sql_limit' => $this->sql_limit, + ); + + /** This filter is documented in includes/core/class-member-directory.php */ + do_action( 'um_user_before_query', $query, $this ); + /* * * SQL_CALC_FOUND_ROWS is deprecated as of MySQL 8.0.17 @@ -1068,13 +1078,6 @@ if ( ! class_exists( 'um\core\Member_Directory_Meta' ) ) { {$this->sql_limit}" ); - $query = array( - 'select' => $this->select, - 'sql_where' => $sql_where, - 'having' => $this->having, - 'sql_limit' => $this->sql_limit, - ); - $total_users = (int) $wpdb->get_var( 'SELECT FOUND_ROWS()' ); /**