I try to use wordpress configured as multisite. The /posts url return posts fine except one site.
From one site (site_id:2) where posts is actually exists the /posts api endpoint returns an empty array.
Another endpoints like /media and /comments returns json with data which refers to some posts by id. But endponts like /posts/{id} where id is actually posts returns error json with error:
{"code":"rest_post_invalid_id","message":"Invalid post ID.","data":{"status":404}}
When I call get_current_site() at the place where above error is fired it return same data for all the sites (for all urls which is associated to each site), however for (site_id: 1 or 3) as mentioned above list of posts generated by rest api is not empty, problem only with /posts for site id:2.
What are possible to check?
Is any palce in wp where I can intercept all sql queries?