# איך מפעילים את האפשרות לפרסום לפוסט טייפ בלי פרסום אוטומטי?

**URL:** https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495
**Category:** WordPress
**Created:** [23 במרץ,‏ 2025,‏ 1:15pm UTC](https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495 "2025-03-23T13:15:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Firsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firsh/32/454861_2.png) [@Firsh](https://meta.discourse.org/u/Firsh)
#### Post date: [23 במרץ,‏ 2025,‏ 1:15pm UTC](https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495/1 "2025-03-23T13:15:55Z")

</div>

I have the normal “post” post type that gets auto-published as expected using the [WP Discourse](https://github.com/discourse/wp-discourse) plugin. I also have another post type, that is Gutenberg-editor-enabled, but the only way I can assign existing or freshly/manually-created-topics (by the community) to it if I mark it here:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/9/a/39ab9abd45785a7b57f97f4ba6a7777d0607d158.png)  
But marking that not only enables the Discourse-related UI here (top-right corner of the editor):  
 ![image](https://global.discourse-cdn.com/meta/original/4X/c/1/4/c1454d1ef94294405527ab7c2383200e08fd819b.png)  
But also auto-publishes everything I do with posts of this type as well. **How do I separate these concerns?** I’m a dev and if pointed to the right direction I could apply some code. I prefer to manually link entries from this post type with their topics in the forum, if any.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [23 במרץ,‏ 2025,‏ 2:43pm UTC](https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495/3 "2025-03-23T14:43:21Z")

</div>

I can be wrong; I don’t think you can do with the settings alone.

What about using `Exclude Posts By Tag`? You could apply automatically (with a plugin) a specific tag to these custom post types. Would it that work for you?

You also can filter with code with `wpdc_publish_after_save`.

> <https://github.com/discourse/wp-discourse/blob/main/lib/discourse-publish.php#L101>

---

<div class="post-metadata">

### Author: ![Firsh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firsh/32/454861_2.png) [@Firsh](https://meta.discourse.org/u/Firsh)
#### Post date: [23 במרץ,‏ 2025,‏ 11:00pm UTC](https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495/4 "2025-03-23T23:00:01Z")

</div>

Yeah the filter was the key! I have this as part of a class and seems to work fine:

```plaintext
add_filter('wpdc_publish_after_save', [$this, 'prevent_autopublish_for_konyv'], 10, 3);

public function prevent_autopublish_for_konyv($publish_to_discourse, $post_id, $post)
	{
		if ('konyv' === get_post_type($post)) {
			return false; // Prevent auto-publishing for 'konyv' post type
		}
		return $publish_to_discourse; // Allow normal behavior for other post types
	}

```

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [22 באפריל,‏ 2025,‏ 11:00pm UTC](https://meta.discourse.org/t/hot-to-enable-publishability-for-a-post-type-without-auto-publish/358495/5 "2025-04-22T23:00:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
