在使用wp-interpost时设置Facebook wordpress插件字段


Set Facebook wordpress plugin fields while using wp-insert-post

我使用wp-insert-post在wordpress中动态创建帖子。脚本在一个外部文件中,我包含了wp-load.php文件,以利用那里的wordpress函数。我的问题是,在使用wp-inter-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);

但这是行不通的。我还试着使用wordpress函数,比如,Wp_set_object_terms,但即使这样也不起作用。

https://github.com/facebookarchive/wordpress/blob/master/admin/social-publisher/publish-box-page.php

以下链接可能提供附加信息