Hi,
Can you explain what you’re trying to do?
Thanks 🙂
Regards,
Hardeep
Thread Starter
tkhan
(@tkhan)
Hi thanks for getting back to me, I am trying to let the user change the order of the comments by highest rating lowest rating etc. at the moment I can order the comments by:
”orderby’ => ‘meta_value_num’,
‘order’ => ‘DESC’,
‘meta_key’ => ‘meta_option_1′,’
I would like to grab the values of each slider and create a new comment meta_key (meta_option_total) on submit so I can order the comments on the total values.
Thanks
Tkhan
Plugin Contributor
MariusG
(@marius_codeinwp)
Hello Tkhan,
You can edit cwp_add_comment_meta_values function from inc/cwp_comment.php
This function saves all ratings for a comment. You can change it to get the average value and save it as comment_meta.
After that, when listing the comments you can sort them by that value.
Happy Holidays,
Marius
Thread Starter
tkhan
(@tkhan)
Hi thanks Marius got it working.
Tkhan
Plugin Contributor
MariusG
(@marius_codeinwp)
Glad to hear that, congrats! 🙂
Marius