Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace wpdb::__get with native Blog::table #22

Open
carlomanf opened this issue Jul 17, 2023 · 1 comment
Open

Replace wpdb::__get with native Blog::table #22

carlomanf opened this issue Jul 17, 2023 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@carlomanf
Copy link
Owner

The query transformations often make use of wpdb::__get, which was always intended to be a temporary measure. The use of the global variable means that the query does not get correctly transformed if a blog happens to be queried without being switched to.

Instead, there should be an object for the current blog, which can return its table names with Blog::table and will assist with transforming the query for subnetworks. (see #2)

@carlomanf carlomanf added this to the v1.3.0 milestone Jul 17, 2023
@carlomanf carlomanf added the bug Something isn't working label Jul 17, 2023
@carlomanf
Copy link
Owner Author

if a blog happens to be queried without being switched to.

This point opens a can of worms because the question becomes whether a query should be transformed for a blog that does not have the plugin active. The plugin is required to be activated network-wide to avoid such a scenario within a network, but when subnetworks are possible, there might need to be a similar mechanism to ensure that the plugin is active on every subnetwork of a given root network.

A forced form of #4 for the active plugins sitemeta value is a possible idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant