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( 'posts_search', 'm_cars_search_vin' ); | |
function m_cars_search_vin( $where ) { | |
global $pagenow, $wpdb, $wp; | |
// check if we are on the right page & performing a search & for the right post type | |
if ( 'edit.php' != $pagenow || ! is_search() || ! isset( $wp->query_vars['s'] ) || 'cars' != $wp->query_vars['post_type'] ) { | |
return $where; |