WordPress.org

Make WordPress Core

Changes between Version 10 and Version 11 of Ticket #25408, comment 3


Ignore:
Timestamp:
10/20/2013 05:01:35 PM (8 years ago)
Author:
DaveAl
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25408, comment 3

    v10 v11  
    55
    66In essence:
    7 I've added two new functions to class WP_List_Table, both intended to be over-ridden, but not abstract:
     7I've added two new methods to class WP_List_Table, both intended to be over-ridden, but not abstract:
    881. get_primary_column(): Takes no arguments, returns the name of the desired primary column. Hardcoded much the same way as get_columns, but just one string.
    992. handle_actions( $item, $column_name, $primary ): Takes three arguments: the item - whether post, user, comment, etc. - the current column_name, and the name of the primary column. If the column name matches the primary, then the function returns the actions to be displayed.
     
    1111I've also modified the various list tables that display row actions to use this new functionality. Some have single_row over-ridden, some don't. Some override the row_actions function, others just directly created and displayed their row actions in the default primary. The latter ones are where I extracted that code to override handle_actions.
    1212
    13 The only one I didn't touch was class-wp-links-list-table.php because I don't have the links manager plugin yet, so I left that one alone.
     13The only one I didn't touch was class-wp-links-list-table.php because I don't have the links manager plugin to test it with yet, so I left that one alone.
    1414
    1515Here's a list of the files I modified, which will now have the class "has-row-actions" in the primary cells.