From: Anthony Talarico Date: Mon, 23 Nov 2015 21:03:03 +0000 (-0500) Subject: added regex X-Git-Tag: v1.0.0^2~272^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=581add097a3d848094c0340fcaaa4b5c9e5ef111;p=WP-Themes%2Fstaffords.git added regex --- diff --git a/search.php b/search.php index 8aac996..f334542 100644 --- a/search.php +++ b/search.php @@ -38,7 +38,7 @@ // Load content as plain text global $wp_query, $post; $content = (!post_password_required($post) ? strip_tags(preg_replace(array("/\r?\n/", '@<\s*(p|br\s*/?)\s*>@'), array(' ', "\n"), apply_filters('the_content', $post->post_content))) : ''); - + $content = preg_replace('!\s+!', ' ', $content); // Search content for terms $terms = $wp_query->query_vars['search_terms']; if ( preg_match_all('/'.str_replace('/', '\/', join('|', $terms)).'/i', $content, $matches, PREG_OFFSET_CAPTURE) ) {