• Download Gist
csv-to-sorttable-add-header-row-plugin.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<?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' );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.