当我在循环中调用 get_post_custom 时,它可以正常工作。但它在我的屏幕上打印 38。这是一个wp错误还是什么?我该如何解决?
更多信息:当我调用 get_post_meta 时也会发生这种情况。我正在使用自定义字段模板插件。
$args = array(
'post_type' => 'attendeeaddress',
'meta_query' => array(
array(
'key' => 'MEETING_ID',
'value' => $meeting_id,
'meta_compare' => '='
)
)
);
$wpquery = new WP_Query($args);
$addresses = array();
while ( $wpquery->have_posts() ) : $wpquery->the_post();
$custom_val = get_post_custom(the_ID());
$addresses[] = array(
"address" => $custom_val["MEETING_ADDRESS"][0],
"meeting_id" => $meeting_id,
"lat" => $custom_val["MEETING_LAT"][0],
"lon" => $custom_val["MEETING_LON"][0],
"name" => $custom_val["NAME"][0]
);
endwhile;
return $addresses;