Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Example of how to add a header row to the table data array, using my CSV-to-SortTable plugin for WordPress. Add this to your `functions.php` file.

View csv-to-sorttable-add-header-row.php
1 2 3 4 5 6 7 8 9 10 11 12 13
<?php
/**
* 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' );

Thank you, very helpful when hootsuite scheduled messages downloads as a csv with no header row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.