Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#54301 reopened defect (bug)

It is not possible to set 0 as post title

Reported by: h71's profile h71 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.5
Component: Posts, Post Types Keywords: has-patch
Focuses: Cc:

Description

I want to have a post and its title is 0 but when I set 0 as the post title, after saving, it shows (no title).

Attachments (1)

54301.diff (487 bytes) - added by sayedulsayem 3 years ago.
patch added.

Download all attachments as: .zip

Change History (8)

This ticket was mentioned in PR #1772 on WordPress/wordpress-develop by sayedulsayem.


3 years ago
#1

  • Keywords has-patch added

I want to have a post and its title is 0 but when I set 0 as the post title, after saving, it shows (no title).

Trac ticket: https://core.trac.wordpress.org/ticket/54301

@sayedulsayem
3 years ago

patch added.

#2 @sayedulsayem
3 years ago

  • Version set to trunk

the title is coming from this function $title = _draft_or_post_title(); . In this function there is an empty check like if ( empty( $title ) ) . This will return false when $title = 0; . Need to change this condition. I added a patch with it.

Committer: Please ignore my PR. I messed up/ something wrong with PR. Please consider this patch.

Last edited 3 years ago by sayedulsayem (previous) (diff)

This ticket was mentioned in PR #1773 on WordPress/wordpress-develop by sayedulsayem.


3 years ago
#3

0 as post title

Trac ticket: https://core.trac.wordpress.org/ticket/54301

#4 follow-up: @audrasjb
3 years ago

  • Version trunk deleted

Hello, it appears this issue wasn't introduced in WP 5.9, so I'm removing the trunk version from the ticket.

#5 in reply to: ↑ 4 ; follow-up: @azouamauriac
3 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Replying to audrasjb:

Hello, it appears this issue wasn't introduced in WP 5.9, so I'm removing the trunk version from the ticket.

Hello i'm new here, I've just tested it and I can confirm the bug.

but in my dashboard here is wordpress version i have https://prnt.sc/26he9l4. Although i've downloaded wordpress from svn and i'm on trunk branch...

am I missing something? thanks

Last edited 3 years ago by azouamauriac (previous) (diff)

#6 in reply to: ↑ 5 ; follow-up: @SergeyBiryukov
3 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened
  • Version set to 2.5

Replying to azouamauriac:

Hello i'm new here, I've just tested it and I can confirm the bug.

but in my dashboard here is wordpress version i have https://prnt.sc/26he9l4. Although i've downloaded wordpress from svn and i'm on trunk branch...

Hi there, welcome to WordPress Trac!

That is correct, the current trunk version is 6.0-alpha. The comment above just meant that the Version field generally indicates which version the issue was introduced in, and trunk would be used for any issues specific to the current release cycle. While the issue still exists in WordPress 5.9, it can also be reproduced in older WordPress versions, so it's not specific to 5.9.

The original line was introduced in [6864] for WordPress 2.5, so that would be the earliest affected version here. The line was later moved to _draft_or_post_title() in [9041] / #7801 for WordPress 2.7.

Some other related tickets: #17115, #48965, #49853.

Last edited 3 years ago by SergeyBiryukov (previous) (diff)

#7 in reply to: ↑ 6 @azouamauriac
3 years ago

Replying to SergeyBiryukov:

Replying to azouamauriac:

Hello i'm new here, I've just tested it and I can confirm the bug.

but in my dashboard here is wordpress version i have https://prnt.sc/26he9l4. Although i've downloaded wordpress from svn and i'm on trunk branch...

Hi there, welcome to WordPress Trac!

That is correct, the current trunk version is 6.0-alpha. The comment above just meant that the Version field generally indicates which version the issue was introduced in, and trunk would be used for any issues specific to the current release cycle. While the issue still exists in WordPress 5.9, it can also be reproduced in older WordPress versions, so it's not specific to 5.9.

The original line was introduced in [6864] for WordPress 2.5, so that would be the earliest affected version here. The line was later moved to _draft_or_post_title() in [9041] / #7801 for WordPress 2.7.

Some other related tickets: #17115, #48965, #49853.

hi thank you for the answer. i've also test the patch(on current trunk 6.0-alpha-52448-src) and it seems like everything is good...

Last edited 3 years ago by azouamauriac (previous) (diff)
Note: See TracTickets for help on using tickets.