我使用代码。
<?php
echo \'<table>
<thead>
<tr style="font-weight: bold;">
<td style="width: 50%;">Название<br>Сумма взноса</td>
<td style="text-align: center;">Мод игры и<br>Кол-во </td>
<td style="text-align: center;">ID<br>заявки и<br>участника
</td>
<td style="text-align: center;">Вступить<br>в схватку</td>
</tr>
</thead>
<tbody>\' ;
$filters = array(
\'post_type\' => \'shop_order\',
\'post_status\' => \'wc-completed\',
\'order\' => \'ASC\',
);
$loop = new WP_Query ($filters);
while ($loop->have_posts()) {
$loop->the_post();
$order = new WC_Order ($loop->post->ID);
$user = $order->get_user();
$user_id = $order->get_user_id();
foreach ($order->get_items() as $key => $lineItem) {
//uncomment the following to see the full data
// echo \'<pre>\';
// print_r($lineItem);
// echo \'</pre>\';
echo \'<tr><td>\'. $lineItem[\'name\'] .\'</br>\';
echo $lineItem->get_meta(\'vznos\').\' - \';
echo $lineItem[\'total\'] .\' руб.</td>\';
echo \'<td style="text-align: center;">\' .$lineItem->get_meta(\'mod-igry\').\'<hr style="padding: 0;margin: 0;color: black;background: #23282d;">\';
echo $lineItem->get_meta(\'kolichestvo-uchastnikov\').\'</td>\';
echo \'<td style="text-align: center;">\'. $lineItem[\'order_id\'] .\'<hr style="padding: 0;margin: 0;color: black;background: #23282d;">\';
echo $user_id.\'</td>\';
echo \'<td style="text-align: center;">Схватка</td></tr>\';
}
}
echo \'</tbody></table></br>\' ;
?>
我需要解决的是,只返回订单数据-我强制指定的ID?
Here is what I get svary.club/zayavka-na-uchastie