Last active
April 5, 2017 16:34
-
-
Save kasparsd/bc181bff6a13819c9bf7280db4c8cac5 to your computer and use it in GitHub Desktop.
Remove piped-label fields from Storage for Contact Form 7 export CSV
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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