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

Authors Widget: add filter to allow adding your own arguments to get_users #13141

Closed
jeherve opened this issue Jul 29, 2019 · 3 comments
Closed
Assignees
Labels
[Feature] Extra Sidebar Widgets Good For Community [Pri] Low [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Type] Good First Bug
Milestone

Comments

@jeherve
Copy link
Member

jeherve commented Jul 29, 2019

The Authors Widget allows you to display a list of users from your site.

$authors = get_users(

We've added a filter, jetpack_widget_authors_exclude, allowing you to exclude some specific users from being displayed on the site.

However, we could also add a filter for the whole array passed to get_users, this way folks could add their own arguments, such as order or orderby.

Suggested here:
https://developer.jetpack.com/hooks/jetpack_widget_authors_exclude/#comment-19398

@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Extra Sidebar Widgets [Type] Good First Bug [Pri] Low Good For Community labels Jul 29, 2019
@ghost
Copy link

ghost commented Jul 31, 2019

Adding a filter for all params going into the get_users call would technically make the jetpack_widget_authors_exclude duplicative. Should the current filter be phased out in favor of filtering all the params going into get_users?

@jeherve
Copy link
Member Author

jeherve commented Jul 31, 2019

Hey Tim 👋:) Happy to see you here!

Yes, I think it'd make sense to deprecate the old filter once we have a new filter in place that will give more flexibility.

@jeherve jeherve added this to the 7.7 milestone Aug 2, 2019
@ghost
Copy link

ghost commented Aug 2, 2019

Hey Tim 👋:) Happy to see you here!

Hey! Happy to be back :) Sorry, I didn't see this until now. How are you?

mdawaffe pushed a commit that referenced this issue Aug 14, 2019
* Add a new filter to update all parameters of the `get_user` function call in the Jetpack Authors widget.

See #13141

* Added `jetpack_widget_authors_exclude` to the deprecated hooks list and added the deprecated notice to the docblock. Other minor changes to make the parsers happy. Feedback thanks to @jeherve.
@jeherve jeherve closed this as completed Aug 19, 2019
@jeherve jeherve self-assigned this Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extra Sidebar Widgets Good For Community [Pri] Low [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Type] Good First Bug
Projects
None yet
Development

No branches or pull requests

1 participant