Skip to content

Commit

Permalink
Try to refactor out the create_function call
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjn authored Feb 9, 2018
1 parent 93ffb3a commit b97e6f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/classes/class-srm-post-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ private function get_search_terms() {

if ( ! empty( $s ) ) {
preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', stripslashes( $s ), $matches );
$search_terms = array_map( create_function( '$a', 'return trim( $a, "\\"\'\\n\\r " );' ), $matches[0] );
$search_terms = array_map( function( $a ) {
return trim( $a, "\\"'\\n\\r " );
}, $matches[0] );
}
return $search_terms;
}
Expand Down

0 comments on commit b97e6f0

Please sign in to comment.