[wp-trac] [WordPress Trac] #33521: manage_${post_type}_posts_columns parameters shifted

WordPress Trac noreply at wordpress.org
Sun Aug 23 23:04:31 UTC 2015


#33521: manage_${post_type}_posts_columns parameters shifted
-------------------------------+------------------------------
 Reporter:  Cybr               |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:  4.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  administration
-------------------------------+------------------------------

Comment (by Cybr):

 Replying to [comment:1 DrewAPicture]:
 > So, which hook exactly are you reporting an issue with? And where are
 you seeing an indication that that hook "requires" 3 parameters?

 Whoops! Sorry about the mix-up. I've been working for too long :3

 This is regarding the manage_{$slug}_posts_custom_column action hook as
 stated in:
 https://codex.wordpress.org/Plugin_API/Action_Reference/manage_$post_type_posts_custom_column

 Replying to [comment:1 DrewAPicture]:
 > In your example, you're using `manage_{$slug}_custom_column` for both
 post types and taxonomies, in which case you'd want to pass the `$type`
 value instead of `$slug` because the hook in the Terms list table is
 expecting a screen ID.

 Passing $type instead of $slug will not work on taxonomies, unfortunately.
 The whole function returns void.

 Therefor I'm passing the $slug, which does work, from there I fetch the
 screen using `$screen = get_current_screen();` and then `$type =
 $screen->taxonomy;` or `$type = $screen->id;` as in the example above
 within the `render_column_bug_fixed()` function.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33521#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list