WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/08/2006 09:42:05 PM (14 years ago)
Author:
ryan
Message:

Move home and siteurl update events to action hooks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options.php

    r4144 r4175  
    8787    }
    8888
    89     // Save for later.
    90     $old_siteurl = get_option('siteurl');
    91     $old_home = get_option('home');
    92 
    9389    if ($options) {
    9490        foreach ($options as $option) {
     
    9692            $value = trim(stripslashes($_POST[$option]));
    9793            $value = sanitize_option($option, $value);
    98 
    99             if (update_option($option, $value) ) {
    100                 $any_changed++;
    101             }
     94            update_option($option, $value);
    10295        }
    10396    }
    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     }
    11897   
    11998    $referred = remove_query_arg('updated' , wp_get_referer());
Note: See TracChangeset for help on using the changeset viewer.