Car Demon Code Docs

  1. Home
  2. Car Demon Code Docs
  3. Display Filters
  4. cd_searched_by_filter


This filter can be used to modify the “Searched by” section that appears below the “Results Found:” section on a vehicle search page.

This is the section that lists each of the items search with an X next to them, which you can see highlighted in the image below.

apply_filters( ‘cd_searched_by_filter’, $searched_by );

Searched By

add_filter( 'cd_searched_by_filter', 'my_searched_by_func', 10, 1 );
function my_searched_by_func( $searched_by ) {

    $searched_by = str_replace( '<span class="search_by_comma">,</span>', ' - ', $searched_by );

    return $searched_by;

The above example will replace all occurrences of <span class=”search_by_comma”>,</span> with a simple dash – character

Was this article helpful to you? Yes No

How can we help?