Skip to content

Conversation

@cfaria
Copy link

@cfaria cfaria commented May 29, 2024

Hi @loureirorg,

can you consider merging this PR to the next plugin version?

I've added two filters:
uewm_custom_columns
uewm_custom_column_value_xxxxxxxx

Then we can hook them to add custom values to the CSV export for each user.

I personally use them to have data that it's not as user meta. For instance, I use the WooCommerce Subscriptions plugin and this allows me to have a column with the subscription status for each user. Sth like this:

add_filter('uewm_custom_columns', function( $columns ) {
    $columns[] = 'subscription-status';

    return $columns;
});

add_filter('uewm_custom_column_value_subscription-status', function( $value, $user_id ) {
    if ( wcs_user_has_subscription( $user_id, '', 'active' ) ) {
        return 'active';
    }

    return '-';
}, 10, 2);

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant