Hide sold listings in dashboard
I want to hide the sold results in the dashboard when users click the sold button.
I've figured the second query in the tpl-dashboard would do the trick; but I can't figure out how to join the meta info in there .. Can someone help me by adding " cp_ad_sold key = no " to the query - or is this not possible?
I flagged the posts so when they are created they are set as cp_ad_sold = no; so the new listings should show up ... I just can't figure out where to join the custom fields...
Here's the query:
$sql = "SELECT ID, post_title, post_name, post_status, post_date "
. "FROM $wpdb->posts "
. "WHERE post_author = $userdata->ID AND post_type = 'ad_listing' "
. "AND (post_status = 'publish' OR post_status = 'pending' OR post_status = 'draft') "
. "AND $wpdb->posts.ID "
. "ORDER BY ID DESC";
Any help is appreciated!!