Code Duplication    Length = 15-15 lines in 2 locations

packages/status/src/Status.php 1 location

@@ 52-66 (lines=15) @@
49
	 *
50
	 * @return boolean
51
	 */
52
	public function is_multi_network() {
53
		global $wpdb;
54
55
		// if we don't have a multi site setup no need to do any more
56
		if ( ! is_multisite() ) {
57
			return false;
58
		}
59
60
		$num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" );
61
		if ( $num_sites > 1 ) {
62
			return true;
63
		}
64
65
		return false;
66
	}
67
}
68

class.jetpack.php 1 location

@@ 1395-1409 (lines=15) @@
1392
	 * @since  3.3
1393
	 * @return boolean
1394
	 */
1395
	public static function is_multi_network() {
1396
		global  $wpdb;
1397
1398
		// if we don't have a multi site setup no need to do any more
1399
		if ( ! is_multisite() ) {
1400
			return false;
1401
		}
1402
1403
		$num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" );
1404
		if ( $num_sites > 1 ) {
1405
			return true;
1406
		} else {
1407
			return false;
1408
		}
1409
	}
1410
1411
	/**
1412
	 * Trigger an update to the main_network_site when we update the siteurl of a site.