Thanks for the answer and sorry for the delay of mine!
Perfect 🙂
Hi James
Thank you for your help, it works !
I’ve tried with an array of ID, it doesn’t work, it returns an empty array.
Here is what I’ve done, unfortunately it doesn’t work…
Do you have an idea ?
Thank you very much for your time.
<?php
$preargs = array(
'post_type' => 'offres'
);
$the_query = new WP_Query( $preargs );
$offres_id = array(); //added
while ( $the_query->have_posts() ) : $the_query->the_post();
$offres_id[] = get_the_ID();
endwhile;
// $arraydeidoffre RETURNS : array(7) { [0]=> int(25747) [1]=> int(25356) [2]=> int(24140) [3]=> int(23097) [4]=> int(23054) [5]=> int(22286) [6]=> int(12005) }
$propositions = get_posts(array(
'post_type' => 'proposition',
'numberposts' => -1,
'meta_query' => array(
array(
'key' => 'offre_liee',
'value' => $offres_id,
'compare' => 'IN'
)
)
));
var_dump($propositions);
?>
Ok thanks, it’s perfect !
I thought we had to give all the object to the query but only the ID is enough!
Thanks very much