From: Anthony Talarico Date: Mon, 23 Nov 2015 21:06:37 +0000 (-0500) Subject: adjusting regex X-Git-Tag: v1.0.0^2~272^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=4f8627131965b847badc857da29079113e13d115;p=WP-Themes%2Fstaffords.git adjusting regex --- diff --git a/search.php b/search.php index 357b357..5a7175f 100644 --- a/search.php +++ b/search.php @@ -37,8 +37,9 @@ // Load content as plain text global $wp_query, $post; + $content = preg_replace('/[\n\r]+/', '', $content); $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('/[\n\r]+/', '', $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) ) {