• Resolved soroka95

    (@soroka95)


    Hi! Great plugin, but if I search with parenthesis – “Lenovo Legion 5 17IMH05 (82B30093RA)” it doesn’t find anything, but if I remove parenthesis ‘(‘ ‘)’ – “Lenovo Legion 5 17IMH05 82B30093RA” it works well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sumit Singh

    (@5um17)

    Hi,

    This is expected behavior. You will need custom snippet for that, I can try to provide one if you still need help.

    Thanks

    Thread Starter soroka95

    (@soroka95)

    It would be great!

    Plugin Author Sumit Singh

    (@5um17)

    Please add this to your theme functions.php

    
    /**
     * Remove braces from search query.
     * 
     * @param WP_Query $q
     */
    function wpes_support_14789652($q) {
    	if (function_exists('WPES') && WPES()->is_search($q)) {
    		$search_term = $q->get('s');
    		$q->set('s', str_replace(['(', ')'], ['', ''], $search_term));
    	}
    }
    add_action('pre_get_posts', 'wpes_support_14789652');

    `

    If you are happy with support please leave a review ??

    Thread Starter soroka95

    (@soroka95)

    THANK YOU! Works as expected!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Doesn’t work if search phrase includes parenthesis ‘(‘ ‘)’’ is closed to new replies.