Closed shawfactor closed 11 months ago
I never noticed this. I'll check!
Not much of help, but I started seeing this too after installing this plugin.
This seems only to happen in the block editor especially built-in post types, the classic one is working fine since it doesn't use rest API on auto draft creation If I remember correctly.
By default, block editor gives us the "Auto Draft" title from the rest API when creating a new post but doesn't actually put it into the title field until we hit the save a draft or publish button (grayed when title or content field is empty).
However, in wp_statuses_rest_prepare_for_response
function line 561 set the temporary post status to "private" which forces the publish into a clickable update button and that fill the title field on post creation, though also makes auto-save enabled if you wait for a while it will save the auto draft post.
(I may pointed wrong source) https://github.com/WordPress/gutenberg/blob/f5582817aa2c45ddc7d52dac50025fcfc2a438e3/packages/core-data/src/entities.js#L177-L205
(Originally "auto-draft" before being replaced)
Any new on this, yes it is block editor only, it is a bit beyond my understanding but it is an issue
Unfortunately this is a downside of the lack of extensibility of the Block Editor, to be sure to get the update button, I need to use another field to save the status to use and force the WordPress status to be private. Otherwise you get the Publish button and you cannot customize the post status.
I've been looking at it, I should be able to add a workaround to avoid the "Auto Draft" title when starting a new post. I'll add a PR to this issue asap.
Seems to work, many thanks for a great fix
I have tried to work out why but as soon as the library is in installed the title of any new post, page, cpt etc is Auto Draft this happens as soon as the the post, page, cpt etc is created. Do you have any idea why? if so can this be fixed? It is not big deal but rather confusing for users (I've tried looking in the code but there is nothing obvious).