Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sscovil/5919960 to your computer and use it in GitHub Desktop.
Save sscovil/5919960 to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: CSV to SortTable: Add Header Row
* Plugin URI: https://gist.github.com/sscovil/5919960
* Description: Adds a custom header row to tables created by CSV to SortTable plugin.
* Version: 0.1
* Author: sscovil
* Author URI: http://shaunscovil.com
* License: GPL2
*/
/**
* CSV to SortTable: Add Header Row
*
* @param array $data
* @return array
*/
function csv_to_sorttable_add_header_row( $data ) {
$header_row = array( 'Column 1', 'Column 2', 'Column 3' );
array_unshift( $data, $header_row );
return $data;
}
add_filter( 'csv_to_sorttable_data_array', 'csv_to_sorttable_add_header_row' );
@sscovil
Copy link
Author

sscovil commented Jul 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment