Make WordPress Core


Ignore:
Timestamp:
07/14/2015 05:46:13 PM (11 years ago)
Author:
wonderboymusic
Message:

List Tables:

  • In ->handle_row_actions(), bail immediately if $primary and $column_name do not match. Saves us a nesting level and avoids declaring code that is unusable.
  • In WP_List_Table::single_row_columns(), allow _column_{$name} to be called dynamically by core to avoid having to override the entirety of ->single_row_columns() in WP_MS_Users_List_Table and WP_Posts_List_Table
  • In WP_MS_Sites_List_Table, id is not a column.

Props wonderboymusic, paulwilde.
Fixes #29881.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r33266 r33270  
    12251225                                echo $this->column_cb( $item );
    12261226                                echo '</th>';
    1227                         }
    1228                         elseif ( method_exists( $this, 'column_' . $column_name ) ) {
     1227                        } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
     1228                                echo call_user_func(
     1229                                        array( $this, '_column_' . $column_name ),
     1230                                        $item,
     1231                                        $classes,
     1232                                        $data,
     1233                                        $primary
     1234                                );
     1235                        } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
    12291236                                echo "<td $attributes>";
    12301237                                echo call_user_func( array( $this, 'column_' . $column_name ), $item );
    12311238                                echo $this->handle_row_actions( $item, $column_name, $primary );
    12321239                                echo "</td>";
    1233                         }
    1234                         else {
     1240                        } else {
    12351241                                echo "<td $attributes>";
    12361242                                echo $this->column_default( $item, $column_name );
Note: See TracChangeset for help on using the changeset viewer.