WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 weeks ago

#17435 closed defect (bug) (invalid)

Inaccurate order and orderby values for sortable list table columns

Reported by: johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Administration Keywords:
Focuses: Cc:

Description

WP_List_Table->print_column_headers() detects the 'order' and 'orderby' parameters using $_GET. It should use the values from the actual query object instead.

Example: I have a custom post type that has sortable columns. The default values for 'order' and 'orderby' are overridden in the parse_request hook. WP_List_Table->print_column_headers() ignores these values and just uses the $_GET values. This results in incorrectly highlighted columns.

Patch coming up.

Attachments (1)

17435.patch (1.1 KB) - added by johnbillion 3 years ago.

Download all attachments as: .zip

Change History (5)

johnbillion3 years ago

comment:1 johnbillion3 years ago

  • Keywords has-patch added

Patch.

comment:2 nacin3 years ago

  • Milestone changed from Awaiting Review to 3.2
  • Version changed from 3.2 to 3.1

Nice.

comment:3 johnbillion3 years ago

  • Keywords has-patch removed
  • Resolution set to invalid
  • Status changed from new to closed

Ah you got in there before me nacin.

I'll scrap this actually, it breaks column headings for sortable columns that sort by meta_value. You can get around it by overriding the $_GET values instead of overriding the request in parse_request and everything works nicely.

comment:4 SergeyBiryukov3 weeks ago

  • Milestone 3.2 deleted
Note: See TracTickets for help on using tickets.