[Plugin: Post Ratings] How to view Top Rated Attachments?
-
Hello
Great plugin! ??
Just a question on how to display , in a list, the top rated attachments? I used the sample code from this page but if I set the post_type to “attachment” I just end up with no results.
It looks like it has to do with the MySQL query on line 1027:
WHERE post_status = ‘publish’ AND post_type = ‘{$post_type}’ {$where}If I add in the following variable before the $query:
$postStatus = ($args[‘post_type’] === ‘attachment’) ? ‘inherit’:’publish’;And then update the query like this (line 1031):
WHERE post_status = ‘{$postStatus}’ AND post_type = ‘{$post_type}’ {$where}Then I get a list of attachments.
Would you say that this is an OK change to make? If there’s a better alternative, please be so kind as to point it out?
Cheers,
Riaan
- The topic ‘[Plugin: Post Ratings] How to view Top Rated Attachments?’ is closed to new replies.