A useful WC Sites “Tree” query

Sometimes WC Sites developers are required to efficiently obtain the hierarchical list of objects stored in the various “tree” tables as used by the product (e.g. LocaleTree, PublicationTree, SitePlanTree, AssetRelationTree). For example one might need to obtain the hierarchical list of locales for the current dimensionset (e.g. to deal with exceptions to the default fallback […]