protected function get_query() { static $last = null; static $lastsplit = null; if ($last == $this->q) { return $lastsplit; } $text = preg_replace('/[._-]+/', '', $this->q); $r = explode(' ', $text); if (!array_filter($r)) { return $lastsplit; } $words = extrp_filter_stopwords($r); if (!array_filter($words)) { return $lastsplit; } return array_values(array_unique($words)); }
function extrp_split_title($post_id) { global $extrp_sanitize; $post_title = get_the_title(absint($post_id)); if (!empty($post_title)) { $post_title = $extrp_sanitize->remove_char($post_title); $array = explode(' ', $post_title); return extrp_filter_stopwords($array); } return false; }