0
我進行一些修改與woocomerce產品結果表,我想補充的崗位meta鍵UNIQUE_CODE一些額外的信息,但它不工作,因爲它應該是:着訪問get_post_meta鍵值
$uniquecode = get_post_meta($post->ID, 'unique_code' , true);
$result.='<td>' . $uniquecode. '</td>'; (this result goes in a td)
不執行任何打印
我也嘗試此
$mymeta = get_post_meta($post->ID, 'unique_code', false);
foreach($mymeta as $array) {
if(isset($array['unique_code'])) {
$name = $array['unique_code'];
break;
}
}
$result.='<td>' . $name . print_r($name) . '</td>';(this result goes in a td)
陣列打印1.