Tag posts that are published from WordPress to Discourse

You can use the wpc_publish_body filter to achieve this, e.g.

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 adds post_id as a param to the filter to make the specific case of adding tags to posts of certain types easier.

2 Likes