Using location data from one site with a Multisite install

If you’re wanting to use location data from one site on a WordPress Multisite install on other sites within the network you can make use of the before and after location query hooks. This scenario also only requires a single site license of the plugin. The following code example could be placed in you’re theme’s functions.php file. As you can see the before query hook switches to the site with the ID 1 to pull location data and the after query post switches back to the current site. Change the switch_to_blog function parameter to pull from a different site ID in your network.