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

Multisite support #3

Open
AbeCole opened this issue Aug 5, 2020 · 0 comments
Open

Multisite support #3

AbeCole opened this issue Aug 5, 2020 · 0 comments

Comments

@AbeCole
Copy link

AbeCole commented Aug 5, 2020

Thanks for making this plugin I know it's early alpha but should help me massively in my current project.

Was looking to use this would 'multisite' Wordpress setup, by default that wasn't working as it was returning content for the incorrect site (since that content was already cached). I think the issue is the query key set in src/QueryCache.php, line 79:

$this->key = "query-{$this->query_name}-${user_id}-{$query_hash}-${args_hash}";

By default this ignores the current 'site' in the multisite setup, I've addressed this by modifying it to:

$blog_id = get_current_blog_id();
$this->key = "query-{$blog_id}-{$this->query_name}-${user_id}-{$query_hash}-${args_hash}";

In a bit of a rush at moment so just leaving this issue here as a 'note' and will try to find time to make a proper pull request for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant