您可以使用 wpc_publish_body 过滤器来实现此目的,例如:
add_filter( 'wpdc_publish_body', function( $body, $remote_post_type, $post_id ) {
if ( 'create_post' === $remote_post_type ) {
$body['tags'] = array( 'tag1', 'tag2' );
}
return $body;
}, 10, 3);
2.4.5 版本将 post_id 添加为过滤器的参数,以便更轻松地为特定类型的帖子添加标签。