chapmanu/wp-social-metrics-tracker — pull request #16 by bamadesigner (2014-04-25 22:04:32+00:00)
Title: Adding ability to custom sort/filter social metrics dashboard query

Just wanted to show you some tweaks I made to the plugin today so I could add in my own sorting and filtering. The 'smt_restrict_manage_social_metrics_dashboard' action is the important part in order to add the HTML for filtering and then I simplifed your query in prepare_items() and moved your different sorting mechanisms to a 'pre_get_posts' hook to clean things up. I also added a filter at the end of the 'pre_get_posts' hook so I could filter the query even further with my own tweaks. Adding a 'smt_query' variable to the filter allows me to signify when a social media tracker query is happening, as opposed to any other query, for conditional sorting/filtering purposes. My name is all over the place because that's my method of discovering when I've altered someone else's code. :)