我使用wp-insert-post在wordpress中动态创建帖子。该脚本位于一个外部文件中,我在其中包含了wp-load.php文件以使用那里的wordpress函数。我的疑问是,在使用wp-insert-post函数时,我们可以使用默认参数,但如何包含插件使用的参数(在本例中为Facebook)。
我希望设置这个参数: facebook_page_message_box_message
我尝试使用:
$post = array();
$post['post_type'] = 'post';
$post['post_title'] = 'Custom title';
$post['post_content'] = 'Custom content';
$post['post_author'] = '1';
$post['facebook_page_message_box_message'] = 'Custom Title (to be displayed on the Facebook timeline, when the post is published)';
$post_id = wp-insert-post($post);但这是行不通的。我也尝试过像Wp_set_object_terms这样的wordpress函数,但即使这样也不起作用。
发布于 2015-02-19 14:19:14
https://stackoverflow.com/questions/28599630
复制相似问题