Opened 3 years ago

Closed 3 years ago

#12398 closed defect (bug) (fixed)

Reinstate manage_pages_columns filter missing in wp_manage_posts_columns()

Reported by: studiograsshopper Owned by: nacin
Priority: high Milestone: 3.0
Component: Editor Version: 3.0
Severity: normal Keywords: has-patch, commit
Cc:

Description

It looks like the abstraction work in wp-admin/includes/template.php, specifically in function wp_manage_posts_columns(), is missing the manage_pages_column filter. (There's a @todo at line 672).

This issue is related to #9674https://core.trac.wordpress.org/ticket/9674

Attachments (2)

template.php.diff (990 bytes) - added by studiograsshopper 3 years ago.
Updated to deal with custom post types
12398-typofix.patch (677 bytes) - added by TobiasBg 3 years ago.
Patch to correct $post_columns typos

Download all attachments as: .zip

Change History (9)

  • Keywords needs-patch added; manage_pages_columns filter removed

What about custom post types? Shouldn't they also have that filter present?

Updated to deal with custom post types

Oops! Forgot about custom post types. Ok, I've added something for custom post types, using the format manage_{$post_type}_columns. Since custom post types can be named anything, this seems the logical way to do it.

comment:3 follow-up: ↓ 5   nacin3 years ago

  • Owner set to nacin
  • Status changed from new to reviewing

manage_{$post_type}_columns might not work as it might clash with other existing filters, such as one in get_column_headers() and 'manage_media_columns'.

This is a good start though. Just a style note, we generally put the variable on the right in comparisons, that way you don't accidentally do an assignment (see your first patch).

  • Resolution set to fixed
  • Status changed from reviewing to closed

(In [13451]) Restore manage_pages_columns filter in wp_manage_posts_columns(). Pass post type to manage_posts_columns, and add a manage_{$post_type}_posts_columns filter. fixes #12398

comment:5 in reply to: ↑ 3   studiograsshopper3 years ago

Replying to nacin:

manage_{$post_type}_columns might not work as it might clash with other existing filters, such as one in get_column_headers() and 'manage_media_columns'.

This is a good start though. Just a style note, we generally put the variable on the right in comparisons, that way you don't accidentally do an assignment (see your first patch).

Thanks for pointing that out. :-)

  • Keywords has-patch, commit added; needs-patch removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

[13451] introduces typos ($post_columns instead of $posts_columns) that break the enhancement.
The attached patch corrects those.

Patch to correct $post_columns typos

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [13455]) Fix typos. props TobiasBg fixes #12398

Note: See TracTickets for help on using tickets.