Opened 2 years ago

Closed 19 months ago

#15970 closed defect (bug) (duplicate)

Hyphen in custom post type breaks admin pagination

Reported by: ejdanderson Owned by:
Priority: normal Milestone:
Component: Post Types Version: 3.1
Severity: normal Keywords: has-patch 3.2-early
Cc: johnbillion@…

Description

Custom post types with a hyphen (possibly other non-alphabetical/numeric) in their name break pagination on the admin side. I was unable to navigate past the first page and I could not set the screen option to display a custom number of posts per page.

Attachments (3)

15970.diff (2.9 KB) - added by ryan 2 years ago.
15970.2.diff (4.8 KB) - added by SergeyBiryukov 19 months ago.
Refreshed patch
15970.3.diff (4.8 KB) - added by SergeyBiryukov 19 months ago.
With @access private

Download all attachments as: .zip

Change History (13)

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

comment:2   ryan2 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Since sanitize_key() allows hyphens, we should probably handle this.

ryan2 years ago

comment:3   ryan2 years ago

  • Milestone changed from Awaiting Review to Future Release

Since this is not a recent regression and there is an easy workaround for plugin authors, let's punt this to 3.2 instead of addressing for 3.1.

After a little more testing and initially setting this ticket to invalid, I found that it was not the hyphen breaking the pagination but rather the has_archive argument. See ticket:16013

The hyphen does appear to break the ability to set the show on screen number.

  • Cc johnbillion@… added
  • Keywords has-patch 3.2-early added; custom post type naming removed

Would like to see this fixed in 3.2, as ryan wants to punt it to 3.2.

Note that this affects not only post types but also taxonomies with hyphens in name.

Closed as duplicate: #16064

Patch still applies clean.

Refreshed patch

With @access private

See also #18958

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from reopened to closed

Since #18958 has some commits against it, I'll mark this ticket as a dupe.

Note: See TracTickets for help on using tickets.