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

Allow customization of downloads sort order #9763

Open
itsananderson opened this issue Oct 24, 2024 · 0 comments
Open

Allow customization of downloads sort order #9763

itsananderson opened this issue Oct 24, 2024 · 0 comments
Assignees
Labels
type-request workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.

Comments

@itsananderson
Copy link

itsananderson commented Oct 24, 2024

Enhancement Request

In the EDD User Downloads block, the downloads are sorted alphabetically by product name. It would be useful to be able to use a different sorting algorithm.

Explain your enhancement (please be detailed)

The downloads block seems to use a fixed ksort to order user downloads before rendering them.

Ideally it would be helpful if this order was configurable with a WordPress filter.

Justification or use case

While alphabetical ordering is reasonable for many use cases, it doesn't work for all cases. I sell a Bundle that includes items for each release of a digital product, and I use semver versioning for my release names. Unfortunately, when you sort semver versions alphabetically, you don't always get the correct ordering. For example:

Expected Ordering:

1.0.0
1.0.1
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9
1.0.10

ksort Ordering:

1.0.0
1.0.1
1.0.10
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.0.7
1.0.8
1.0.9

Adding a WordPress filter for the download list would make it possible to choose a custom sorting algorithm. In addition to semver sorting, it would also be possible to sort by publish date or other properties of the download item details.

@itsananderson itsananderson added type-request workflow-pending-triage Items that need to be triaged and reviewed before they are worked on. labels Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-request workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.
Projects
None yet
Development

No branches or pull requests

2 participants