Changeset 35024
- Timestamp:
- 10/11/2015 10:43:59 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-network.php
r34819 r35024 146 146 147 147 $default = ucfirst( $this->domain ); 148 $this->site_name = get_network_option( 'site_name', $default, $this->id);148 $this->site_name = get_network_option( $this->id, 'site_name', $default ); 149 149 } 150 150 -
trunk/src/wp-includes/ms-functions.php
r35016 r35024 1344 1344 if ( ! is_subdomain_install() ) { 1345 1345 1346 if ( 'https' === parse_url( get_ network_option( 'siteurl' ), PHP_URL_SCHEME ) ) {1346 if ( 'https' === parse_url( get_site_option( 'siteurl' ), PHP_URL_SCHEME ) ) { 1347 1347 $siteurl = set_url_scheme( $siteurl, 'https' ); 1348 1348 } -
trunk/src/wp-includes/option.php
r34931 r35024 1000 1000 */ 1001 1001 function get_site_option( $option, $default = false, $deprecated = true ) { 1002 return get_network_option( $option, $default );1002 return get_network_option( null, $option, $default ); 1003 1003 } 1004 1004 … … 1018 1018 */ 1019 1019 function add_site_option( $option, $value ) { 1020 return add_network_option( $option, $value );1020 return add_network_option( null, $option, $value ); 1021 1021 } 1022 1022 … … 1033 1033 */ 1034 1034 function delete_site_option( $option ) { 1035 return delete_network_option( $option );1035 return delete_network_option( null, $option ); 1036 1036 } 1037 1037 … … 1049 1049 */ 1050 1050 function update_site_option( $option, $value ) { 1051 return update_network_option( $option, $value );1051 return update_network_option( null, $option, $value ); 1052 1052 } 1053 1053 … … 1062 1062 * @global object $current_site 1063 1063 * 1064 * @param int $network_id ID of the network. Can be null to default to the current network ID. 1064 1065 * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. 1065 1066 * @param mixed $default Optional. Value to return if the option doesn't exist. Default false. 1066 * @param int|bool $network_id Optional. ID of the network. Defaults to current network ID.1067 1067 * @return mixed Value set for the option. 1068 1068 */ 1069 function get_network_option( $ option, $default = false, $network_id= false ) {1069 function get_network_option( $network_id, $option, $default = false ) { 1070 1070 global $wpdb, $current_site; 1071 1071 … … 1175 1175 * @global object $current_site 1176 1176 * 1177 * @param string $option Name of option to add. Expected to not be SQL-escaped.1178 * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped.1179 * @param int|bool $network_id Optional. ID of the network. Defaults to current network ID.1177 * @param int $network_id ID of the network. Can be null to default to the current network ID. 1178 * @param string $option Name of option to add. Expected to not be SQL-escaped. 1179 * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped. 1180 1180 * @return bool False if option was not added and true if option was added. 1181 1181 */ 1182 function add_network_option( $ option, $value, $network_id = false ) {1182 function add_network_option( $network_id, $option, $value ) { 1183 1183 global $wpdb, $current_site; 1184 1184 … … 1216 1216 $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); 1217 1217 if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) { 1218 if ( false !== get_network_option( $ option, false, $network_id) ) {1218 if ( false !== get_network_option( $network_id, $option, false ) ) { 1219 1219 return false; 1220 1220 } … … 1281 1281 * @global object $current_site 1282 1282 * 1283 * @param string $option Name of option to remove. Expected to not be SQL-escaped.1284 * @param int|bool $network_id Optional. ID of the network. Defaults to current network ID.1283 * @param int $network_id ID of the network. Can be null to default to the current network ID. 1284 * @param string $option Name of option to remove. Expected to not be SQL-escaped. 1285 1285 * @return bool True, if succeed. False, if failure. 1286 1286 */ 1287 function delete_network_option( $ option, $network_id = false) {1287 function delete_network_option( $network_id, $option ) { 1288 1288 global $wpdb, $current_site; 1289 1289 … … 1359 1359 * @global object $current_site 1360 1360 * 1361 * @param int $network_id ID of the network. Can be null to default to the current network ID. 1361 1362 * @param string $option Name of option. Expected to not be SQL-escaped. 1362 1363 * @param mixed $value Option value. Expected to not be SQL-escaped. 1363 * @param int|bool $network_id Optional. ID of the network. Defaults to current network ID.1364 1364 * @return bool False if value was not updated and true if value was updated. 1365 1365 */ 1366 function update_network_option( $ option, $value, $network_id = false ) {1366 function update_network_option( $network_id, $option, $value ) { 1367 1367 global $wpdb, $current_site; 1368 1368 … … 1376 1376 wp_protect_special_option( $option ); 1377 1377 1378 $old_value = get_network_option( $ option, false, $network_id);1378 $old_value = get_network_option( $network_id, $option, false ); 1379 1379 1380 1380 /** … … 1398 1398 1399 1399 if ( false === $old_value ) { 1400 return add_network_option( $ option, $value, $network_id);1400 return add_network_option( $network_id, $option, $value ); 1401 1401 } 1402 1402 -
trunk/tests/phpunit/tests/option/networkOption.php
r34777 r35024 16 16 $value = rand_str(); 17 17 18 add_ network_option( $option, $value );19 $this->assertFalse( get_network_option( $ option, false, $id) );18 add_site_option( $option, $value ); 19 $this->assertFalse( get_network_option( $id, $option, false ) ); 20 20 } 21 21 … … 25 25 $value = rand_str(); 26 26 27 add_network_option( $ option, $value, $id);28 $this->assertEquals( $value, get_network_option( $ option, false, $id) );27 add_network_option( $id, $option, $value ); 28 $this->assertEquals( $value, get_network_option( $id, $option, false ) ); 29 29 } 30 30 … … 34 34 $value = rand_str(); 35 35 36 add_ network_option( $option, $value );37 add_network_option( $ option, $value, $id);38 delete_ network_option( $option );39 $this->assertEquals( $value, get_network_option( $ option, false, $id) );36 add_site_option( $option, $value ); 37 add_network_option( $id, $option, $value ); 38 delete_site_option( $option ); 39 $this->assertEquals( $value, get_network_option( $id, $option, false ) ); 40 40 } 41 41 }
Note: See TracChangeset
for help on using the changeset viewer.