[wp-trac] [WordPress Trac] #54983: The post has already been deleted.
WordPress Trac
noreply at wordpress.org
Sat Jan 29 10:38:21 UTC 2022
#54983: The post has already been deleted.
-------------------------------+------------------------------------------
Reporter: sumitsingh | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version: 5.9
Severity: major | Resolution:
Keywords: has-screenshots | Focuses: administration, performance
-------------------------------+------------------------------------------
Comment (by costdev):
It's acceptable to create a post with no title OR no content, but
`wp_insert_post()` does not allow a post to have no title AND no content.
{{{#!php
<?php
$new_post = wp_insert_post( array( 'post_title' => '', 'post_content' =>
'' ) );
var_dump( $new_post ); // Will be (int) 0
}}}
However, the change in [https://core.trac.wordpress.org/changeset/47191
47191] turns `''` into `<!-- wp:paragraph --><!-- /wp:paragraph -->` for
Quick Drafts, which means the post now has content and gets created. I
have submitted a patch to #48120 to resolve this.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54983#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list