- March 9, 2019 at 8:26 pm #21537
I have a user custom field that stores a date like “2019-03-09”. All users have this date custom field. Is there a way to add a toggle to the search that will trigger results to be sorted by that date? Or is there a way to by default sort all user search results by that date (even without a frontend toggle)?
Thanks for any help!March 9, 2019 at 9:21 pm #21538
I also know I can modify the user_registered field with my custom date data, and then use the sort by date feature in Ordering. The main issue with this is I don’t know how to have a frontend search field to toggle it on and off. (Also I don’t want to keep overwriting the user_registered field with my custom data). Any thoughts would be appreciated!March 11, 2019 at 11:17 am #21555
Well, I’m afraid that none of this is possible at this point, at least not without major modifications to the current code.
I am working on a solution for front-end ordering filters, it should be available within the next two patches, although it depends a lot on the test results as wel. The custom field ordering you can set on the ordering panel only affects the post types. There will be additional two options there in the upcoming release to set a separate ordering for user results as well.
I’m afraid there is no quick bypass solution/custom code for this, as the implementation for ordering by custom fields requires major changes to the main query as well as other files.
The ordering by custom fields for user results will be definitely implemented in the upcoming release, front-end filter for ordering probably in the one after that.Best,
If you like my products, don't forget to rate them on codecanyon :)
You must be logged in to reply to this topic.