Make WordPress Core

Opened 9 months ago

Last modified 3 weeks ago

#58824 new enhancement

Add a filter to change the classes in posts list table in admin

Reported by: zahardoc's profile zahardoc Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: good-first-bug has-patch
Focuses: ui, css, administration Cc:

Description

Currently, there is no way to change the classes in the posts list table, and the posts list table template is hardcoded. So there is no way to add any classes, for example, specific classes for custom post types there.

Proposal:

Add a filter to "WP_List_Table::get_table_classes()" function, like this:

<?php
return apply_filters( 'post_list_table_classes', array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] ), $this );

Change History (3)

#1 @Hareesh Pillai
9 months ago

  • Keywords good-first-bug added

This ticket was mentioned in PR #4885 on WordPress/wordpress-develop by @pamprn.


9 months ago
#2

  • Keywords has-patch added

This ticket was mentioned in PR #6299 on WordPress/wordpress-develop by djpbateman.


3 weeks ago
#3

Added filter and an array checker for safety.

Note: See TracTickets for help on using tickets.