• Hi!

    Thank you very much for this great plugin. I have users who have several roles at the same time. When doing the export only one appears to me. I wanted to know if there is a way to show all the roles that a user has.

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    please, follow to https://docs.algolplus.com/algol_order_export/fields/

    add key customer_roles

    use this code 

    add_filter('woe_get_order_value_customer_roles',function ($value, $order,$fieldname) {
    global $wp_roles;
    if(!$order->get_user_id()) return ""; // guest
    $roles = $wp_roles->roles;
    $user = get_userdata( $order->get_user_id() );
    $names = array();
    foreach($user->roles as $role)
      $names[] = isset( $roles[ $role ] ) ? $roles[ $role ]['name'] : $role;
    return join(",", $names);
    },10,3);

Viewing 1 replies (of 1 total)

The topic ‘Various user roles export’ is closed to new replies.