Notifications
Clear all

How to list the comments based on meta key?

2 Posts
2 Users
0 Reactions
2,109 Views
(@keerthi92)
Active Member
Joined: 6 years ago
Posts: 10
Topic starter  

Hi @tomson

 Thank you for your reply.This is useful for me.Then my another question is how to list the comments based on meta key?

add_action('pre_get_comments', function($query)
{

$query->query_vars['meta_query'] = [
'relation' => 'AND',
[
'key' => 'contest_id',
'value' => $_GET['voteid']
]
];

});

The above code is working for initial load only.When sorting or click load more comments
it is not working in wpdiscuz .Could you please help me

Thank you


   
Quote
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4214
 

It works fine for as. It also works for all type of loading and pagination. Make sure that key exists fro all comments.

Please make sure you don't have other plugins affecting comment displaying functions and leave a screenshot of the Settings > Discussions admin page.


   
ReplyQuote
Share:
Scroll to top