Skip to content

Commit

Permalink
Fix: column value getting overridden when multiple custom columns are…
Browse files Browse the repository at this point in the history
… added
  • Loading branch information
Nikschavan committed Oct 1, 2020
1 parent 1847504 commit 535e527
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions classes/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@ public function column_default( $item, $column_name ) {

if ( ! empty( $inserted_columns ) && is_array( $inserted_columns ) ) {
foreach ( $inserted_columns as $column_title ) {

// Set default value of column to column name.
if ( empty( $out ) ) {
$out = $column_name;
}

/**
* If column title inserted via wp_stream_register_column_defaults ($column_title) exists
* among columns registered with get_columns ($column_name) and there is an action associated
Expand All @@ -413,8 +419,6 @@ public function column_default( $item, $column_name ) {
* @return string
*/
$out = apply_filters( "wp_stream_insert_column_default_{$column_title}", $column_name, $record );
} else {
$out = $column_name;
}
}
} else {
Expand Down

0 comments on commit 535e527

Please sign in to comment.