The National Gallery of Art said it had closed its office of belonging and inclusion to comply with a presidential order.