$args = array(
\'post_type\' => \'appointments\',
\'meta_query\' => array(
\'relationship\' => \'AND\',
array(
\'key\' => \'location\',
\'value\' => $place //set this somewhere
),
array(
\'key\' => \'timestamp\',
\'value\' => $time //set this somewhere
)
)
);
$posts = new WP_Query( $args );
文档:
WP_Query
您可以灵活地添加任何其他需要的内容,例如,post_status
.