Skip to content

Instantly share code, notes, and snippets.

@kasparsd
Last active April 5, 2017 16:34
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 kasparsd/bc181bff6a13819c9bf7280db4c8cac5 to your computer and use it in GitHub Desktop.
Save kasparsd/bc181bff6a13819c9bf7280db4c8cac5 to your computer and use it in GitHub Desktop.
Remove piped-label fields from Storage for Contact Form 7 export CSV
<?php
add_filter( 'cf7_storage_csv_columns', function( $rows ) {
foreach ( $rows as &$row ) {
foreach ( $row as $field_name => $field_value ) {
if ( false !== strpos( $field_name, '-pipe-label' ) ) {
unset( $row[ $field_name ] );
}
}
}
return $rows;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment