The filter wc_memberships_csv_export_user_memberships_query_args can’t have the $export_args variable :
“`
$query_args = (array) apply_filters( ‘wc_memberships_csv_export_user_memberships_query_args’, $query_args );
“`
My use case is to add a new option in the export form to get all active access membership members (add active, complimentary, free_trial, and pending in the $query_args[‘post_status’]).
Open
Last updated: November 3, 2025
Log in to comment on this feature request.
And in the class-wc-memberships-ajax.php add a filter for allow to change the attrs given to the create_job :
“`
wp_send_json_success( (array) $export_handler->create_job( [
‘user_membership_ids’ => empty( $_POST[‘user_membership_ids’] ) ? $export_handler->get_user_memberships_ids_for_export( $export_args ) : array_map( ‘absint’, $_POST[‘user_membership_ids’] ),
‘include_profile_fields’ => isset( $export_args[‘include_profile_fields’] ) && ‘yes’ === $export_args[‘include_profile_fields’],
‘include_meta_data’ => isset( $export_args[‘include_meta’] ) && ‘yes’ === $export_args[‘include_meta’],
‘fields_delimiter’ => ! empty( $export_args[‘fields_delimiter’] ) ? sanitize_text_field($export_args[‘fields_delimiter’]) : ‘comma’,
‘date_format’ => ! empty( $export_args[‘date_format’] ) ? sanitize_text_field($export_args[‘date_format’]) : ”,
‘custom_date_format’ => ! empty( $export_args[‘custom_date_format’] ) ? sanitize_text_field($export_args[‘custom_date_format’]) : ”,
] ) );
“`