WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#12398 closed defect (bug) (fixed)

Reinstate manage_pages_columns filter missing in wp_manage_posts_columns()

Reported by: studiograsshopper Owned by: nacin
Milestone: 3.0 Priority: high
Severity: normal Version: 3.0
Component: Editor Keywords: has-patch, commit
Focuses: 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 7 years ago.
Updated to deal with custom post types
12398-typofix.patch (677 bytes) - added by TobiasBg 7 years ago.
Patch to correct $post_columns typos

Download all attachments as: .zip

Change History (9)

#1 @scribu
7 years ago

  • Keywords needs-patch added; manage_pages_columns filter removed

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

@studiograsshopper
7 years ago

Updated to deal with custom post types

#2 @studiograsshopper
7 years ago

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.

#3 follow-up: @nacin
7 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).

#4 @nacin
7 years ago

  • 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

#5 in reply to: ↑ 3 @studiograsshopper
7 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. :-)

#6 @TobiasBg
7 years ago

  • 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.

@TobiasBg
7 years ago

Patch to correct $post_columns typos

#7 @nacin
7 years ago

  • 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.