Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using "Filter By Role" always returns empty #3

Closed
Synaestesia opened this issue Apr 10, 2012 · 6 comments
Closed

Using "Filter By Role" always returns empty #3

Synaestesia opened this issue Apr 10, 2012 · 6 comments

Comments

@Synaestesia
Copy link

Hi,

this is a very nice plugin, but I found a issue in "filter by role".
I am working with the italian translation of Wordpress, and the query at line 225 ($users = get_users( $args )) always returns an empty array.
I notice that also the values of the select field are the translated ones, and I think this could be the reason.

Thank you,

Fabio

@lewismcarey
Copy link
Owner

Hi Fabio,

Thank you for pointing this out. I have had a prior issue with translation and I am grateful for you help.
If you could answer the following, while I investigate the issue:

Can you confirm you are using this latest commit?
Which values are translated? The filter by role values...E.G. line 92?

Thank you

@Synaestesia
Copy link
Author

Yes, I am using the last commit, and the translated values are exactly the roles specified in line 92.
In fact simply removing the translation from the array $choices partially resolve the problem($choices[$name] = $name;): get_users( $args ) returns the correct items, but obviously the user role are no more translated.

Thanks!

PS. I am very new to this kind of discussion on GitHub. I am sorry if I am missing some of its conventions; and of course I am sorry for my poor english.

@lewismcarey
Copy link
Owner

Thanks Fabio.

I just need to work out how to translate the name without translating the value and I will be able to fix.

Thank you for your help and I will post when I have an update.

@lewismcarey
Copy link
Owner

Hello Fabio,

On Lines 84 & 85 ...

line 84: $name = translate_user_role($details['name'] );
line 85: $choices[$name] = $name;

Please can you try replacing with

line 84: $choices[$details['name']] = translate_user_role( $details['name'] );

And let me know if that works please.

Thank you.

@lewismcarey
Copy link
Owner

Hello Fabio

I have added this to the latest commit, can you test before I close this issue please.

Thank you.

@Synaestesia
Copy link
Author

Hi,

it works perfectly, thanks for your effort!

Fabio

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

No branches or pull requests

2 participants