WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#23623 closed defect (bug) (fixed)

Can't edit the content of a post with no title

Reported by: wonderboymusic Owned by: markjaquith
Milestone: 3.6 Priority: normal
Severity: normal Version: 2.1
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description (last modified by wonderboymusic)

  1. Add new post screen: post-new.php
  1. Don't enter a title, enter some arbitrary content: "This is a post."
  1. Click "Publish"
  1. Erase the content, then press Update

*Spoiler alert: The content is still there*

  1. Add a title
  1. Repeat steps 3 & 4

*Works*

This is important because some post formats don't need a title

Attachments (2)

23623.diff (891 bytes) - added by wonderboymusic 2 years ago.
23623.2.diff (891 bytes) - added by markjaquith 2 years ago.
Same, but removed 'link'

Download all attachments as: .zip

Change History (11)

comment:1 @wonderboymusic2 years ago

  • Description modified (diff)

comment:2 follow-up: @azaozz2 years ago

Thinking this should go the other way: the default posts can be without a title, but shouldn't be without content, i.e. saving or publishing a post of type 'post' or 'page' without content should be rejected.

comment:3 @SergeyBiryukov2 years ago

  • Component changed from General to Post Types
  • Version changed from trunk to 2.1

Publishing is not necessary, reproduced with saving as a draft it as well.

Caused by $maybe_empty check in wp_insert_post():
http://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/post.php#L2727

Related: [4147] (for #2390), [19305] (for #18713), #17115.

@wonderboymusic2 years ago

comment:5 @wonderboymusic2 years ago

  • Keywords has-patch added

Fixes this issue using similar technique from #23887

comment:6 in reply to: ↑ 2 @markjaquith2 years ago

Replying to azaozz:

Thinking this should go the other way: the default posts can be without a title, but shouldn't be without content, i.e. saving or publishing a post of type 'post' or 'page' without content should be rejected.

Thoroughly disagree. I use no-content posts all the time (say, to act as a page stub for a plugin to act upon).

@markjaquith2 years ago

Same, but removed 'link'

comment:7 @markjaquith2 years ago

.2.diff removes "link" — if you don't have a title or content, there's nothing to wrap the link around.

comment:8 @markjaquith2 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In 23986:

Allow the content of no-title audio, video, quote, and image posts to be blanked.

props wonderboymusic. fixes #23623.

comment:9 @azaozz2 years ago

I use no-content posts all the time (say, to act as a page stub for a plugin to act upon).

Right, have used that too. Wondering if we need to be looking at the post format meta fields when determining whether a post is "empty". For example: saving a video post with empty wp_format_video meta and no title or content.

Note: See TracTickets for help on using tickets.