wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



network_domain_check › WordPress Function

Depuis3.0.0
Dépréciéen/a
network_domain_check ( Pas de paramètres )
Retourne:
  • (string|false) Base domain if network exists, otherwise false.
Défini(e) dans:
Codex:

Check for an existing network.



Source

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;
}