🧠 WP Query SQL: SELECT wp_hx6pgu_posts.* FROM wp_hx6pgu_posts WHERE 1=1 AND wp_hx6pgu_posts.ID = 5899 AND wp_hx6pgu_posts.post_type = 'post' AND wp_hx6pgu_posts.ID NOT IN ( SELECT ID FROM wp_hx6pgu_posts WHERE post_type IN ('post','page','attachment','blog','case-study','legend','product','video') AND ID IN ( SELECT post_id FROM wp_hx6pgu_postmeta pm WHERE pm.meta_key = 'groups-read' AND pm.meta_value NOT IN (2) AND pm.meta_value IN ( SELECT group_id FROM wp_hx6pgu_groups_group ) AND post_id NOT IN ( SELECT post_id FROM wp_hx6pgu_postmeta pm WHERE pm.meta_key = 'groups-read' AND pm.meta_value IN (2) ) ) ) AND wp_hx6pgu_posts.ID IN ( SELECT ID FROM wp_hx6pgu_posts WHERE ID NOT IN ( SELECT post_id FROM wp_hx6pgu_postmeta WHERE wp_hx6pgu_postmeta.meta_key = 'groups-groups_read_post' ) UNION ALL SELECT post_id AS ID FROM wp_hx6pgu_postmeta WHERE wp_hx6pgu_postmeta.meta_key = 'groups-groups_read_post' AND wp_hx6pgu_postmeta.meta_value IN ('premium_user') ) ORDER BY wp_hx6pgu_posts.post_date DESC