Changeset 35024 for trunk/src/wp-includes/option.php
- Timestamp:
- 10/11/2015 10:43:59 PM (10 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/option.php (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.