Make WordPress Core


Ignore:
Timestamp:
07/14/2015 05:46:13 PM (9 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-media-list-table.php

    r33269 r33270  
    648648     */
    649649    protected function handle_row_actions( $post, $column_name, $primary ) {
    650         if ( $primary === $column_name ) {
    651             $att_title = _draft_or_post_title();
    652             return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
    653         }
     650        if ( $primary !== $column_name ) {
     651            return '';
     652        }
     653
     654        $att_title = _draft_or_post_title();
     655        return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
    654656    }
    655657}
Note: See TracChangeset for help on using the changeset viewer.