# Tag posts that are published from WordPress to Discourse

**URL:** <https://meta.discourse.org/t/tag-posts-that-are-published-from-wordpress-to-discourse/99927>\
**Category:** Administrators\
**Tags:** wordpress, how-to\
**Created:** [10월 19, 2018, 1:32오전 UTC](https://meta.discourse.org/t/tag-posts-that-are-published-from-wordpress-to-discourse/99927 "2018-10-19T01:32:11Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [7월 6, 2022, 11:11오전 UTC](https://meta.discourse.org/t/tag-posts-that-are-published-from-wordpress-to-discourse/99927/9 "2022-07-06T11:11:18Z")

</div>

`wpc_publish_body` 필터를 사용하여 이를 구현할 수 있습니다. 예를 들어 다음과 같습니다.

```php
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`를 매개변수로 추가하여, 특정 유형의 게시글에 태그를 추가하는 특정 사례를 더 쉽게 처리할 수 있도록 했습니다.

---

_[View the full topic](https://meta.discourse.org/t/tag-posts-that-are-published-from-wordpress-to-discourse/99927)._
