Thought this would work since it looks like you are just stringing together terms using $wpdb->prepare to create a query.
Any hints on why it’s not working ? it just returns no results. I’m sure if I spend enough time I’ll figure it out but you can probably point me in the right direction and cut my time by a lot. I look forward to this implementation in the future! Also happy to buy support if that includes helping me get this working til the official release.
Appreciate your time!
foreach ( (array) $q['search_terms'] as $term2 ) {
$term = $f . $wpdb->esc_like( $term2 ) . $l;
$OR = '';
$search .= "{$searchand} (";
if ( isset( $q['_is_includes']['search_title'] ) ) {
$search .= $wpdb->prepare( "({$wpdb->posts}.post_title {$like} '%s')", $term );
$OR = ' OR ';
}
// my code starts here
if(true){
$cleanTerm = str_replace('%', '', $term);
if( 1 == is_numeric($cleanTerm)){
$search .= $wpdb->prepare( "(SELECT * FROM {$wpdb->posts} WHERE ID = %d)", $term );
}
}