Code Duplication    Length = 15-15 lines in 2 locations

class.jetpack.php 1 location

@@ 1462-1476 (lines=15) @@
1459
	 * @since  3.3
1460
	 * @return boolean
1461
	 */
1462
	public static function is_multi_network() {
1463
		global  $wpdb;
1464
1465
		// if we don't have a multi site setup no need to do any more
1466
		if ( ! is_multisite() ) {
1467
			return false;
1468
		}
1469
1470
		$num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" );
1471
		if ( $num_sites > 1 ) {
1472
			return true;
1473
		} else {
1474
			return false;
1475
		}
1476
	}
1477
1478
	/**
1479
	 * Trigger an update to the main_network_site when we update the siteurl of a site.

packages/status/src/class-status.php 1 location

@@ 113-127 (lines=15) @@
110
	 *
111
	 * @return boolean
112
	 */
113
	public function is_multi_network() {
114
		global $wpdb;
115
116
		// If we don't have a multi site setup no need to do any more.
117
		if ( ! is_multisite() ) {
118
			return false;
119
		}
120
121
		$num_sites = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->site}" );
122
		if ( $num_sites > 1 ) {
123
			return true;
124
		}
125
126
		return false;
127
	}
128
129
	/**
130
	 * Whether the current site is single user site.