Remove duplicated create_function calls an use a private _search_terms_tidy function instead for tidying up the post/page searching when looking to attach orphans to a parent post or page.

git-svn-id: https://develop.svn.wordpress.org/trunk@12052 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2009-10-18 11:50:59 +00:00
parent fa3370c044
commit c61e6f6bbd
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -1197,7 +1197,7 @@ case 'find_posts':
$what = isset($_POST['pages']) ? 'page' : 'post';
$s = stripslashes($_POST['ps']);
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
$search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
$search_terms = array_map('_search_terms_tidy', $matches[0]);
$searchand = $search = '';
foreach( (array) $search_terms as $term) {