# בחר אוטומטית קטגוריית נושא על סמך קטגוריית הפוסט?

**URL:** <https://meta.discourse.org/t/automatically-select-topic-category-based-on-post-category/229058>\
**Category:** WordPress\
**Created:** [5 ביוני,‏ 2022,‏ 11:12am UTC](https://meta.discourse.org/t/automatically-select-topic-category-based-on-post-category/229058 "2022-06-05T11:12:35Z")\
**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:** [10 באוקטובר,‏ 2022,‏ 7:33am UTC](https://meta.discourse.org/t/automatically-select-topic-category-based-on-post-category/229058/9 "2022-10-10T07:33:20Z")

</div>

While there isn’t a dedicated tags filter, there is a general filter you can use: `wpdc_publish_body`. In your case it’ll look like this

```php
add_filter( 'wpdc_publish_body', function( $body, $remote_post_type, $post_id ) {
   // code to get the post policy category
   if ( // if there is a post policy ) {
      $policy_tags = // map the post policy category to the appropriate tag(s)
      $body['tags'] = $policy_tags
   }
   return $body;
}, 10, 3);

```

---

_[View the full topic](https://meta.discourse.org/t/automatically-select-topic-category-based-on-post-category/229058)._
