You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 17, 2021. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
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 isWP_Site
.Suggested Solution
Even if you
require_once()
the files with these symbols, i.e.wp-includes/ms-sites.php
andwp-includes/class-wp-site.php
,get_site()
still returnsnull
. Therefore, it is necessary to detect such cases, and perhaps return a fakeWP_Site
instance if the main site is requested.The text was updated successfully, but these errors were encountered: