Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sscovil
Created June 17, 2013 17:30
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/5798612 to your computer and use it in GitHub Desktop.
Save sscovil/5798612 to your computer and use it in GitHub Desktop.
Code example of how to remove the first row from a CSV file that is imported by the CSV to SortTable plugin for WordPress. Add this code you your `functions.php` file.
<?php
/**
* CSV to SortTable: Remove First Row
*
* @param array $data
* @return array
*/
function csv_to_sorttable_remove_first_row( $data ) {
array_shift( $data );
return $data;
}
add_filter( 'csv_to_sorttable_data_array', 'csv_to_sorttable_remove_first_row' );
@javiercb
Copy link

Hi sscovil, Great plugin,
I have a question fot you, ¿its posible to show only lines that match a string on certain column?

Something like this

//shows rows that match AR on column 1
[csv src=http://example.com/myfile.csv show=1,AR]

//shows rows that match Oxford on column 0
[csv src=http://example.com/myfile.csv show=0,Oxford]

on the attachmen the image display only rows containing AR as state or oxford as city.
state-or-city

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