Change order of custom columns for edit panels

You are basically asking a PHP question, but I’ll answer it because it’s in the context of WordPress. You need to rebuild the columns array, inserting your column before the column you want it to be left of:

add_filter('manage_posts_columns', 'thumbnail_column');
function thumbnail_column($columns) {
  $new = array();
  foreach($columns as $key => $title) {
    if ($key=='author') // Put the Thumbnail column before the Author column
      $new['thumbnail'] = 'Thumbnail';
    $new[$key] = $title;
  }
  return $new;
}

Leave a Comment