Changeset 4175
- Timestamp:
- 09/08/2006 09:42:05 PM (18 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r4169 r4175 2065 2065 } 2066 2066 2067 // If siteurl or home changed, reset cookies and flush rewrite rules. 2068 function update_home_siteurl($old_value, $value) { 2069 global $wp_rewrite, $user_login, $user_pass_md5; 2070 // If home changed, write rewrite rules to new location. 2071 $wp_rewrite->flush_rules(); 2072 // Clear cookies for old paths. 2073 wp_clearcookie(); 2074 // Set cookies for new paths. 2075 wp_setcookie($user_login, $user_pass_md5, true, get_option('home'), get_option('siteurl')); 2076 } 2077 2078 add_action('update_option_home', 'update_home_siteurl'); 2079 add_action('update_option_siteurl', 'update_home_siteurl'); 2080 2067 2081 ?> -
trunk/wp-admin/options.php
r4144 r4175 87 87 } 88 88 89 // Save for later.90 $old_siteurl = get_option('siteurl');91 $old_home = get_option('home');92 93 89 if ($options) { 94 90 foreach ($options as $option) { … … 96 92 $value = trim(stripslashes($_POST[$option])); 97 93 $value = sanitize_option($option, $value); 98 99 if (update_option($option, $value) ) { 100 $any_changed++; 101 } 94 update_option($option, $value); 102 95 } 103 96 } 104 105 if ($any_changed) {106 // If siteurl or home changed, reset cookies.107 if ( get_option('siteurl') != $old_siteurl || get_option('home') != $old_home ) {108 // If home changed, write rewrite rules to new location.109 $wp_rewrite->flush_rules();110 // Clear cookies for old paths.111 wp_clearcookie();112 // Set cookies for new paths.113 wp_setcookie($user_login, $user_pass_md5, true, get_option('home'), get_option('siteurl'));114 }115 116 //$message = sprintf(__('%d setting(s) saved... '), $any_changed);117 }118 97 119 98 $referred = remove_query_arg('updated' , wp_get_referer());
Note: See TracChangeset
for help on using the changeset viewer.