# Can No Longer Force Publish with Classic Editor?

**URL:** https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057
**Category:** WordPress
**Created:** [June 5, 2022, 11:00am UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057 "2022-06-05T11:00:59Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![oopsyscoops](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oopsyscoops](https://meta.discourse.org/u/oopsyscoops)
#### Post date: [June 5, 2022, 11:00am UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/1 "2022-06-05T11:00:59Z")

</div>

I’m not adopting the new Block features of WordPress and am sticking with Classic.

I just noticed that the [WP Discourse](https://github.com/discourse/wp-discourse) plugin had an update for a setting I use, **Force Publish** :

> This setting is only applied when the Block Editor is used to publish posts.

Bummer, but where there’s a will, there’s a way. Anyone else run into this problem and come up with a custom solution, something to add to the ol’ _functions.php_ file in the theme perhaps?

Thanks

---

<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: [June 6, 2022, 8:09am UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/2 "2022-06-06T08:09:49Z")

</div>

Hey @oopsyscoops, yes, there are some limitations with supporting both editors. You can still use “Auto Publish” setting with the classic editor. Is there an issue with using that in your case?

---

<div class="post-metadata">

### Author: ![oopsyscoops](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oopsyscoops](https://meta.discourse.org/u/oopsyscoops)
#### Post date: [June 7, 2022, 12:35pm UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/3 "2022-06-07T12:35:36Z")

</div>

**Auto Publish** would be fine if this was a single-user blog.

However, as a multi-author blog, **Force Publish** was very helpful.

Before I go digging through the changelog, do you happen to know off the top of your head what version of [WP Discourse](https://github.com/discourse/wp-discourse) moved this feature to the Block editor and removed it from the Classic editor?

I’m not suggesting that I’ll rollback to that version (which would be a terrible idea), but maybe I can dig around the code and patch the old solution back in through my theme.

I hope [WP Discourse](https://github.com/discourse/wp-discourse) doesn’t eventually completely abandon Classic. There are over 6 million (verifiably at least, but it’s probably more) websites using Classic still, and I’m sure millions of people will continue using Classic features indefinitely.

I intend on it and I suspect that Classic features will eventually become officially (and optionally) supported in WP (not relying on plugins) again after the demand is clear, when they realize that even after years, some people simply prefer the Classic and won’t adopt new Block features.

---

<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: [June 7, 2022, 12:52pm UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/4 "2022-06-07T12:52:21Z")

</div>

> [@oopsyscoops](#):
>
> **Auto Publish** would be fine if this was a single-user blog.  
> However, as a multi-author blog, **Force Publish** was very helpful.

I do understand where you’re coming from, but this could just be a case of author training and seeing whether it causes issues in practice? You know your authors better than me, but I wouldn’t discount that as an option.

> [@oopsyscoops](#):
>
> Before I go digging through the changelog, do you happen to know off the top of your head what version of [WP Discourse](https://github.com/discourse/wp-discourse) moved this feature to the Block editor and removed it from the Classic editor?

> <https://github.com/discourse/wp-discourse/blob/main/readme.txt#L262>

> [@oopsyscoops](#):
>
> I hope [WP Discourse](https://github.com/discourse/wp-discourse) doesn’t eventually completely abandon Classic

Classic editor is still definitely supported.

> [@oopsyscoops](#):
>
> I intend on it and I suspect that Classic features will eventually become officially (and optionally) supported in WP (not relying on plugins) again after the demand is clear, when they realize that even after years, some people simply prefer the Classic and won’t adopt new Block features.

I doubt it, but I’ve been wrong before (at least three times that I know of 😉 )

> [@oopsyscoops](#):
>
> I’m not suggesting that I’ll rollback to that version (which would be a terrible idea), but maybe I can dig around the code and patch the old solution back in through my theme.

PR would be welcome if you can address the issues that @simon was seeking to address when removing it ([see for example](https://github.com/discourse/wp-discourse/blob/main/lib/discourse-publish.php#L107)). He can perhaps explain more.

---

<div class="post-metadata">

### Author: ![oopsyscoops](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oopsyscoops](https://meta.discourse.org/u/oopsyscoops)
#### Post date: [June 7, 2022, 5:18pm UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/5 "2022-06-07T17:18:49Z")

</div>

> [@angus](#):
>
> I do understand where you’re coming from, but this could just be a case of author training and seeing whether it causes issues in practice? You know your authors better than me, but I wouldn’t discount that as an option.

It simply isn’t practical. I’ve been an editor for over a decade and trained and managed dozens of writers of every skill level, from complete Luddites, to coders. I’ve only had a handful of good writers that were _also_ tech-savvy and organized enough to follow ALL the guidelines I laid out for them (without struggling).

I could be a stricter Editor (I’m already pretty OCD as it is), but then I’d lose valuable voices. There are just too many great writers I’ve had contribute over the years, who barely knew how to turn on a computer. Many of them have a learning curve in just learning how to publish with WordPress, and wished they could just email me a Word doc instead. 😝

And so, I train the best I can, but at the end of the day, _automation is sanity_.

Anyway, I’d love to learn more about why this feature is too difficult to maintain for Classic AND Block, if I can get a brief recap, @simon? For what it’s worth, I have a partner on one project that insists I allow them to use the Block editor (while everyone else on the team uses the Classic editor), so I do have some experience mixing both, and I get how it can become a pain.

Thanks

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [June 7, 2022, 5:27pm UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/6 "2022-06-07T17:27:13Z")

</div>

> [@angus](#):
>
> PR would be welcome if you can address the issues that @simon was seeking to address when removing it ([see for example](https://github.com/discourse/wp-discourse/blob/main/lib/discourse-publish.php#L107)). He can perhaps explain more.

Yes, it would be great to get the Force Publish option to work with both editors. It’s a couple of years since I last looked at this. I’m not certain what the cause of the issue was, but I suspect it’s something that could be resolved.

---

<div class="post-metadata">

### Author: ![oopsyscoops](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oopsyscoops](https://meta.discourse.org/u/oopsyscoops)
#### Post date: [June 8, 2022, 11:45am UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/7 "2022-06-08T11:45:24Z")

</div>

Okay, we’re looking at this file:

_/lib/ **discourse-publish.php** _

And comparing 2.1.2 and 2.1.3, here are the only differences (concerning Force Publish):

```php
if ( ( 0 === $force_publish_max_age ) || $post_time >= $min_date ) {

```

was changed to:

```php
if ( ( ( 0 === $force_publish_max_age ) || $post_time >= $min_date ) && $is_rest_request ) {

```

And these additional lines were added:

```php
// The Force Publish setting can't be easily supported with both the Block and Classic editors. The $is_rest_request
// variable is used to only allow the Force Publish setting to be respected for posts published with the Block Editor.
$is_rest_request = defined( 'REST_REQUEST' ) && REST_REQUEST;

```

If I had to guess, maybe the old way was throwing errors in the Block editor? So, could it be as simple as using a conditional?

`is_block_editor` or `use_block_editor_for_post` might work:

```php
if ( is_block_editor() ) {
	// do it the new way
} else {
	// do it the old way
}

```

---

<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: [June 9, 2022, 8:52am UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/8 "2022-06-09T08:52:50Z")

</div>

Want to give it a shot and make a PR?

---

<div class="post-metadata">

### Author: ![oopsyscoops](https://avatars.discourse-cdn.com/v4/letter/o/f14d63/32.png) [@oopsyscoops](https://meta.discourse.org/u/oopsyscoops)
#### Post date: [June 9, 2022, 12:03pm UTC](https://meta.discourse.org/t/can-no-longer-force-publish-with-classic-editor/229057/9 "2022-06-09T12:03:35Z")

</div>

If you’re talking to me, I’m definitely not going in guns a blazin’ until @simon recalls why it was removed in the first place (or retraces his steps to learn what it was again). It could be some unknown nightmare to do with the core of WordPress, Discourse, or [WP Discourse](https://github.com/discourse/wp-discourse) that’s not simply an issue contained to these few files and lines of code.
