wp_insert_post两个值变成post_title

wp_insert_post two values into the post_title

我目前正在努力将一些数据插入到我的 post 中,我正在尝试将两组数据插入到 post 标题中,但我有点卡住了。

$my_post = array(
    'post_title' => $data['title'],

这很好用,但我需要在标题中添加另一个,我该怎么做?例如

'post_title' => $data['title'] && $data['count'],

任何帮助将不胜感激,谢谢。

使用点 . 连接标题:

'post_title' => $data['title'] . $data['count'],

有关详细信息,请参阅 string operators 上的 PHP 文档。