On this page
network_domain_check(): string|false
Check for an existing network.
Return
string|false Base domain if network exists, otherwise false.
Source
File: wp-admin/includes/network.php. View all references
function network_domain_check() {
global $wpdb;
$sql = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) );
if ( $wpdb->get_var( $sql ) ) {
return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" );
}
return false;
}
Related
Uses
| Uses | Description |
|---|---|
| wpdb::esc_like() wp-includes/class-wpdb.php | First half of escaping for |
| wpdb::get_var() wp-includes/class-wpdb.php | Retrieves one variable from the database. |
| wpdb::prepare() wp-includes/class-wpdb.php | Prepares a SQL query for safe execution. |
Used By
| Used By | Description |
|---|---|
| get_clean_basedomain() wp-admin/includes/network.php | Get base domain of network. |
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/network_domain_check