Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Site Retrieval Fails In Non-Multisite Environments #2

Open
XedinUnknown opened this issue May 18, 2019 · 0 comments
Open

Site Retrieval Fails In Non-Multisite Environments #2

XedinUnknown opened this issue May 18, 2019 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@XedinUnknown
Copy link
Member

The Symptoms

When activating the plugin, an error message is displayed, saying that the function Dhii\Wp\Containers\get_site() is not found.

Possible Cause

The function get_site() is a WordPress function, but it is not defined in a non-multisite environment. Neither is WP_Site.

Suggested Solution

Even if you require_once() the files with these symbols, i.e. wp-includes/ms-sites.php and wp-includes/class-wp-site.php, get_site() still returns null. Therefore, it is necessary to detect such cases, and perhaps return a fake WP_Site instance if the main site is requested.

@XedinUnknown XedinUnknown added the bug Something isn't working label May 18, 2019
@XedinUnknown XedinUnknown added this to the v0.1 milestone May 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant