Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

How to list the comments based on meta key?

2 Posts
2 Users
0 Reactions
3,033 Views
(@keerthi92)
Active Member
Joined: 7 years ago
Posts: 10
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
  [#3323]

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: 11 years ago
Posts: 4238
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

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