0

function get_related_post_ids_c2($expert_id,$rpost=""){
global $wpdb; 
$prepare_guery = $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta where meta_key ='_cb_gifts_associated_experts' and meta_value like $expert_id", $expert_id );
 $get_values = $wpdb->get_col( $prepare_guery );
 $post_ids = [];
 foreach ( $get_values as $post ) {
         $post_ids[] = $post;
         // do something with the post ID
 }
 return $post_ids;	
}

Jagdish Sarma Asked question April 1, 2023
Add a Comment