Created
August 2, 2021 23:15
-
-
Save tripflex/867ef37c078ff45ed7366f2c0657b1c2 to your computer and use it in GitHub Desktop.
Replace double byte space characters in Job and Resume keyword string before search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'job_manager_get_listings_args', 'smyles_double_space_replace', 999999 ); | |
add_filter( 'resume_manager_get_resumes_args', 'smyles_double_space_replace', 999999 ); | |
/** | |
* Replace Double Byte Space with Regular Space in Search Keywords | |
* | |
* @param $args | |
* | |
* @return mixed | |
* @since @@version | |
* | |
*/ | |
function smyles_double_space_replace( $args ){ | |
if( isset( $args['search_keywords'] ) ){ | |
$args['search_keywords'] = str_replace( ' ', ' ', $args['search_keywords'] ); | |
} | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment