Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#39545 closed enhancement (fixed)

add a filter to allow the date status to be modified in post columns

Reported by: pbearne's profile pbearne Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.8
Component: Posts, Post Types Keywords: has-patch commit
Focuses: Cc:


It should be possible to filter the date status on /wp-admin/edit.php as for a CPT it might not make sense to use Published etc.

Also output not escaped.

Attachments (2)

class-wp-posts-list-table.php.patch (1.3 KB) - added by pbearne 7 years ago.
39545.patch (1.4 KB) - added by SergeyBiryukov 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @pbearne
7 years ago

  • Keywords has-patch dev-feedback added

#2 @SergeyBiryukov
7 years ago

  • Keywords commit added; dev-feedback removed
  • Milestone changed from Awaiting Review to 4.8

39545.patch makes the filter more consistent with post_date_column_time.

A single post_date_column_status filter seems more handy here, as it allows for removing "Published" status text for all post types in one function, and also allows for differentiating per post type by checking the $post argument.

If we also want to add a dynamic $post->post_type-based filter here, let's do the same for post_date_column_time, but I don't see an immediate need in that.

(I also don't think there's a need for escaping here. Translations in core are inherently trusted, and the output of post_date_column_time filter is not escaped either.)

#3 @SergeyBiryukov
7 years ago

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

In 40361:

Posts, Post Types: Introduce post_date_column_status filter for post status text in list tables' Date column.

Props pbearne.
Fixes #39545.

This ticket was mentioned in Slack in #core by pbiron. View the logs.

7 years ago

Note: See TracTickets for help on using tickets.