SELECT `wposts` . `ID` FROM `wp_posts` `wposts` , `wp_postmeta` `wpostmeta` WHERE `wposts` . `ID` = `wpostmeta` . `post_id` AND `wpostmeta` . `meta_key` = ? AND `wpostmeta` . `meta_value` = ? AND `wposts` . `post_type` = ? 