I need someone to re-write the wp_list_comments() function to accept a meta query which will sort ONLY ROOT LEVEL comments by a specified meta value. ie, any 2nd level replies to those comments will be in the correct original order; only root level comments will be sorted by a specified meta value. The function should revert to a standard date order if the meta value isnt specified. So the output might be like:
- comment id 234 (meta value 5)
-- reply to 234 (no meta)
-- another to that (no meta)
- comment id 238 (meta value 3)
- comment id 235 (no meta)
- comment id 245 (no meta)
- comment id 287 (meta value -6)
The function should otherwise be identical to wp_list_comments so it can plugged in where needed.
No dev site provided, please use your own testing. Final delivery should be within 1 week.
(NOTE: Wordpress 3.5 adds the possibility of meta query to comments, but it doesnt work right; the order or subcomments is messed up, and comments without meta dont get included. If you think this is easy because its built in, please dont apply.)
For an example, think of Stack Overflow; highest voted answers come first, but those answers also have replies in date order.