is_multisite()
If Multisite is enabled.
Used By: is_main_site()
1 time — 0.000009 sec (speed of light) | 50000 times — 0.01 sec (speed of light) | PHP 7.0.8, WP 4.6.1
No Hooks.
Return
true|false
. True if Multisite is enabled, false otherwise.
Usage
is_multisite();
Examples
#1 Do anything if multisite mode is enabled
if ( is_multisite() ) { // do staff for multisite }
Changelog
Since 3.0.0 | Introduced. |
is_multisite() is multisite code WP 6.6.2
function is_multisite() { if ( defined( 'MULTISITE' ) ) { return MULTISITE; } if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) { return true; } return false; }