Skip to content

Instantly share code, notes, and snippets.

@tripflex
Created August 2, 2021 23:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/867ef37c078ff45ed7366f2c0657b1c2 to your computer and use it in GitHub Desktop.
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
<?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