Skip to content

Commit

Permalink
Fix #323 : Move disabled dropdown items to bottom of list
Browse files Browse the repository at this point in the history
  • Loading branch information
faishal committed Mar 11, 2014
1 parent 82565e7 commit 666f2c0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions includes/list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,19 @@ function assemble_records( $column, $table = '' ) {
}

$existing_records = existing_records( $column, $table );
$active_records = array();
$disable_records = array();

foreach ( $all_records as $record => $label ) {
if ( array_key_exists( $record , $existing_records ) ) {
$all_records[ $record ] = array( 'label' => $label, 'disabled' => '' );
$active_records[ $record ] = array( 'label' => $label, 'disabled' => '' );
} else {
$all_records[ $record ] = array( 'label' => $label, 'disabled' => 'disabled="disabled"' );
$disable_records[ $record ] = array( 'label' => $label, 'disabled' => 'disabled="disabled"' );
}
}
asort( $all_records );
asort( $active_records );
asort( $disable_records );
$all_records = array_merge( $active_records, $disable_records );
return $all_records;
}

Expand Down

0 comments on commit 666f2c0

Please sign in to comment.