SELECT COUNT ( * ) FROM `wp_term_relationships` , `wp_posts` WHERE `wp_posts` . `ID` = `wp_term_relationships` . `object_id` AND `post_status` IN (?) AND `post_type` IN (...) AND `term_taxonomy_id` = ? 