Modified bnwp_get_terms to be more efficient