Created
January 6, 2017 23:32
-
-
Save barrykooij/3ed8ba4a8797cf97d0de1dc5e5f72e19 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Adding custom filter to WP Car Manager | |
*/ | |
add_action( 'wpcm_listings_vehicle_filters', 'wpcm_custom_template_vehicle_listings_filters_color', 14 ); | |
function wpcm_custom_template_vehicle_listings_filters_color() { | |
wp_car_manager()->service( 'template_manager' )->get_template_part( 'listings/filters/color' ); | |
} | |
add_filter( 'wpcm_get_vehicles_filter_color', 'wpcm_custom_filter_color', 10, 3 ); | |
function wpcm_custom_filter_color( $filter, $key, $val ) { | |
$filter['key'] = 'wpcm_color'; | |
$filter['value'] = sanitize_title( $val ); | |
$filter['type'] = 'CHAR'; | |
return $filter; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment