How to add custom fields to the Export

To add custom fields to the Votes list CSV you could use the following filter (since version 2.3.43):

add_filter('fv/export/votes/csv_data', function($csv_data) {
// Add user_login field
$csv_data['heading'][] = 'user_login';
$csv_data['rows'][] = 'users_user_login';
global $wpdb;
$csv_data['queryModel']->leftJoin( $wpdb->users, "users", "`users`.`ID` = `t`.`user_id`", ['user_login'] );
return $csv_data;
});

Related Articles

Leave A Comment?