wp_insert_post()中的“ meta_input”参数用于什么?
我正在使用wp_insert_post()函数将一些帖子插入wordpress中。 我想在每篇文章中插入一些自定义字段并阅读文档,尽管我使用了meta_info参数,但我尝试过这样的事情: $data = array( 'post_author' => 1, 'post_status' => 'publish', 'post_title' => $post->getTitle(), 'post_content' => $post->getContent(), 'post_category' => $post->getCategory(), 'tags_input' => $post->getTags(), 'meta_input' => array( "_test" => "testx1" ) ); $postID = wp_insert_post( $data ); 该帖子会正确插入并且也有标签。但是没有添加自定义字段。我知道我可以使用add_post_meta()添加它们,但我仍然想知道meta_input参数的用途,因为在插入帖子后我在数据库中搜索了“ testx1”,但找不到任何结果。