mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
More cap migration.
git-svn-id: https://develop.svn.wordpress.org/trunk@2714 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -21,7 +21,7 @@ for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($user_level < 6)
|
||||
if ( !current_user_can('manage_options') )
|
||||
die ( __('Cheatin’ uh?') );
|
||||
|
||||
switch($action) {
|
||||
@@ -50,17 +50,14 @@ case 'update':
|
||||
if ($options) {
|
||||
$options = apply_filters( 'options_to_update' , $options );
|
||||
foreach ($options as $option) {
|
||||
// should we even bother checking?
|
||||
if ($user_level >= $option->option_admin_level) {
|
||||
$old_val = $option->option_value;
|
||||
$new_val = trim($_POST[$option->option_name]);
|
||||
if( in_array($option->option_name, $nonbools) && ( $new_val == '0' || $new_val == '') )
|
||||
$new_val = 'closed';
|
||||
if ($new_val !== $old_val) {
|
||||
$result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'");
|
||||
$any_changed++;
|
||||
}
|
||||
}
|
||||
$old_val = $option->option_value;
|
||||
$new_val = trim($_POST[$option->option_name]);
|
||||
if( in_array($option->option_name, $nonbools) && ( $new_val == '0' || $new_val == '') )
|
||||
$new_val = 'closed';
|
||||
if ($new_val !== $old_val) {
|
||||
$result = $wpdb->query("UPDATE $wpdb->options SET option_value = '$new_val' WHERE option_name = '$option->option_name'");
|
||||
$any_changed++;
|
||||
}
|
||||
}
|
||||
unset($cache_settings); // so they will be re-read
|
||||
get_settings('siteurl'); // make it happen now
|
||||
|
||||
Reference in New Issue
Block a user