Tagga i post pubblicati da WordPress a Discourse

Puoi usare il filtro wpc_publish_body per ottenere questo risultato, ad esempio:

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 aggiunge post_id come parametro al filtro per semplificare il caso specifico di aggiunta di tag a post di determinati tipi.

2 Mi Piace