WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 10 months ago

#38805 new defect (bug)

A hook is missing in class WP_List_Table

Reported by: madvic Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.6.1
Component: Administration Keywords: 2nd-opinion
Focuses: Cc:
PR Number:

Description

If I want to add a column to a WP_List_Table, I used this hooks :

  • manage_{$this->screen->id}_columns
  • manage_{$this->screen->id}_sortable_columns
  • manage_{$screen->id}_custom_column

But the last one doesn't exist in WP_List_Table, I can create a column but I can't insert data into.

Here the documentation :
https://make.wordpress.org/docs/plugin-developer-handbook/10-plugin-components/custom-list-table-columns/#output-table-cell-contents

Here the source of WP_List_Table :
https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/class-wp-list-table.php

Actually, I want to hook a plugin with this hook, I can't add columns.

Thanks

Change History (4)

#2 in reply to: ↑ 1 @madvic
3 years ago

Yes it is, but not in WP_List_Table, we can't hook this class. Ant it used in many projects.

Replying to SergeyBiryukov:

But the last one doesn't exist in WP_List_Table, I can create a column but I can't insert data into.

It exists in classes that extend WP_List_Table though:

Last edited 3 years ago by madvic (previous) (diff)

#3 follow-up: @desrosj
10 months ago

  • Keywords 2nd-opinion added

Marking this for a second opinion. The WP_List_Table is meant to be a base class, but the other two filters do exist in WP_List_Table today. So I could see adding this filter.

@madvic is this still a pain point for you?

#4 in reply to: ↑ 3 @madvic
10 months ago

Hi @desrosj ,

I have to used it for projects.
For me the code is not consistent. That's why my ticket.

Replying to desrosj:

Marking this for a second opinion. The WP_List_Table is meant to be a base class, but the other two filters do exist in WP_List_Table today. So I could see adding this filter.

@madvic is this still a pain point for you?

Note: See TracTickets for help on using tickets.