Hey @vanclute,
You can use the wpdc_publish_after_save filter to achieve this. In your Wordpress functions.php file add the following:
function publish_to_discourse( $force_publish, $post_id, $post ) {
return has_term( TERM, TAXONOMY, $post );
}
add_filter( 'wpdc_publish_after_save', 'publish_to_discourse', 10, 3 );
You’ll need to replace TERM and TAXONOMY with whatever you’re using for “categories” in Wordpress. Note that TERM can be an array, e.g.
array( 'category name 1', 'category name 2')
Example
function publish_to_discourse( $force_publish, $post_id, $post ) {
return has_term( array( 'news', 'blog' ), 'category', $post );
}
add_filter( 'wpdc_publish_after_save', 'publish_to_discourse', 10, 3 );