Ticket #38099: 38099.patch
File 38099.patch, 884 bytes (added by , 7 years ago) |
---|
-
wp-includes/class-wp-query.php
1323 1323 $n = ! empty( $q['exact'] ) ? '' : '%'; 1324 1324 $searchand = ''; 1325 1325 $q['search_orderby_title'] = array(); 1326 1327 /** 1328 * Filters whether to exclude search terms preceded with a hyphen 1329 * 1330 * @since 4.7.0 1331 * 1332 * @param bool Whether the search query exclude terms preceded with a hyphen 1333 */ 1334 $hyphen_exclusion = apply_filters( 'wp_search_exclusion', '__return_true' ); 1335 1326 1336 foreach ( $q['search_terms'] as $term ) { 1327 1337 // Terms prefixed with '-' should be excluded. 1328 1338 $include = '-' !== substr( $term, 0, 1 ); 1329 if ( $include ) {1339 if ( $include || ! $hyphen_exclusion ) { 1330 1340 $like_op = 'LIKE'; 1331 1341 $andor_op = 'OR'; 1332 1342 } else {