在post_date的底部是我需要知道提交/ wordpress帖子时获取的正确字符串的部分.我目前在那里有一个默认日期请求,但这只是当前时间而不是发布时间.你怎么能真正得到这个帖子的日期?我真的很感激帮助!
$surveyArray = array(
'id' => $survey_id,
'title' => $survey_title,
'airline' => $airlineName,
'meal' => $mealName,
'test_great' => $get_test_great[0],
'fair_price' => $get_fair_price[0],
'friendly_host' => $get_friendly_host[0],
'right_temp' => $get_right_temp[0],
'looked_good' => $get_looked_good[0],
'would_reorder' => $get_would_reorder[0],
'comment' => $get_comment[0],
'airlane_race_number' => $get_airlane_race_number[0],
'post_date' => $postdate = date ("Y-m-d H:i:s"),
);
$allAirlinesAndAnswersInArray[] = $surveyArray;
}
解决方法:
请在WordPress.Stackexchange.com打开与WP相关的主题
附:解决方案是:
'post_date' => $postdate = get_the_date( "Y-m-d H:i:s", $survey_id )