Consider my WordPress multisite has the following four websites:
- root/main website:
example-domain.com - subsite 1:
example-domain.com/en - subsite 2:
example-domain.com/cn - subsite 3:
example-domain.com/ar
When a user searches for anything in the root site I want to search/query in all of the websites and display.
Do I have to use the switch_to_blog( $site_id ); function to switch sites one by one to search/query the tables of the website? or any other way to query all the posts tables that exist for the multisite network?