/** * Parse out the limit and offset values from the limit clause. We'll use * this to figure out with page number we need to grab, and how many * results we should find. We'll then store them as class variables for * future use. * * @param string $limit_clause * @return string The same limit clause */ public function limitCallback($limit_clause) { if (!WPSearch_Search::instance()->isReady()) { return $limit_clause; } # Parse out the range of search items to retreive if (is_search() && !is_admin()) { WPSearch_Log::add('debug', "Query limit callback executed"); $limit = str_replace("LIMIT", "", $limit_clause); list($offset, $limit) = split(",", $limit); $offset = intval($offset); $limit = intval($limit); self::$_page = $offset / $limit; self::$_perPage = $limit; } return $limit_clause; }