[wp-trac] [WordPress Trac] #28253: Cannot delete published post
WordPress Trac
noreply at wordpress.org
Fri Jul 18 20:10:25 UTC 2014
#28253: Cannot delete published post
-----------------------------------+-------------------------
Reporter: Parthiban Sagittarius | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Posts, Post Types | Version: 3.9.1
Severity: normal | Resolution: worksforme
Keywords: | Focuses:
-----------------------------------+-------------------------
Changes (by SergeyBiryukov):
* milestone: Awaiting Review =>
Old description:
> Hi, I cannot delete the post publish when I programmably insert post into
> wordpress. Using this part of code:
>
> $post_id = wp_insert_post(
> array(
> 'comment_status' => 'closed',
> 'ping_status' => 'closed',
> 'post_status' => 'publish',
> 'post_type' => 'post',
> 'post_title' => $posttitle,
> 'post_content' => $postcontent,
> )
> );
> when there is no value assign to $posttitle and postcontent, wordpress
> still create a post without any title and content which I can't delete at
> all.
New description:
Hi, I cannot delete the post publish when I programmably insert post into
WordPress. Using this part of code:
{{{
$post_id = wp_insert_post(
array(
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_status' => 'publish',
'post_type' => 'post',
'post_title' => $posttitle,
'post_content' => $postcontent,
)
);
}}}
when there is no value assign to `$posttitle` and `$postcontent`,
WordPress still create a post without any title and content which I can't
delete at all.
--
Comment:
> when there is no value assign to $posttitle and $postcontent, WordPress
still create a post without any title and content which I can't delete at
all.
Could not reproduce on a clean install. Trying to create an empty post
with `wp_insert_post()` results in an error: [source:tags/3.9.1/src/wp-
includes/post.php#L2953 ""Content, title, and excerpt are empty""].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28253#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list