edit order of columns for wordpress

39

//you can do this for users instead of posts aswell
// manage_users_columns VS manage_posts_columns

add_filter('manage_posts_columns', 'column_order');
function column_order($columns) {
  $n_columns = array();
  $before = 'date'; // move before this (it will be the last one in the column to the far right)
 
  foreach($columns as $key => $value) {
    if ($key==$before){
      $n_columns['email_id'] = 'Email To';
      $n_columns['email_to'] = 'Email From';
      $n_columns['email_from'] = 'Email ID';
    }
      $n_columns[$key] = $value;
  }
  return $n_columns;
}

Comments

Submit
0 Comments