Ticket #43598: 43598.diff
File 43598.diff, 2.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/option.php
diff --git src/wp-includes/option.php src/wp-includes/option.php index a80de70..88a0a1f 100644
function get_network_option( $network_id, $option, $default = false ) { 1243 1243 return $pre; 1244 1244 } 1245 1245 1246 // prevent non-existent options from triggering multiple queries 1247 $notoptions_key = "$network_id:notoptions"; 1248 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 1246 if ( is_multisite() ) { 1247 // prevent non-existent options from triggering multiple queries 1248 $notoptions_key = "$network_id:notoptions"; 1249 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 1249 1250 1250 if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) {1251 if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { 1251 1252 1252 /** 1253 * Filters a specific default network option. 1254 * 1255 * The dynamic portion of the hook name, `$option`, refers to the option name. 1256 * 1257 * @since 3.4.0 1258 * @since 4.4.0 The `$option` parameter was added. 1259 * @since 4.7.0 The `$network_id` parameter was added. 1260 * 1261 * @param mixed $default The value to return if the site option does not exist 1262 * in the database. 1263 * @param string $option Option name. 1264 * @param int $network_id ID of the network. 1265 */ 1266 return apply_filters( "default_site_option_{$option}", $default, $option, $network_id ); 1253 /** 1254 * Filters a specific default network option. 1255 * 1256 * The dynamic portion of the hook name, `$option`, refers to the option name. 1257 * 1258 * @since 3.4.0 1259 * @since 4.4.0 The `$option` parameter was added. 1260 * @since 4.7.0 The `$network_id` parameter was added. 1261 * 1262 * @param mixed $default The value to return if the site option does not exist 1263 * in the database. 1264 * @param string $option Option name. 1265 * @param int $network_id ID of the network. 1266 */ 1267 return apply_filters( "default_site_option_{$option}", $default, $option, $network_id ); 1268 } 1267 1269 } 1268 1270 1269 1271 if ( ! is_multisite() ) { … … function get_network_option( $network_id, $option, $default = false ) { 1295 1297 } 1296 1298 } 1297 1299 1298 if ( ! is_array( $notoptions ) ) {1300 if ( isset( $notoptions ) && ! is_array( $notoptions ) ) { 1299 1301 $notoptions = array(); 1300 1302 wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); 1301 1303 }