Revert "Use get_terms instead of wpdb->query & CS"

This reverts commit ee20b2c5d0f676e4ff1e9b0421f9f7275a228a89.
CS