2 require_once('admin.php');
4 $title = __('Settings');
5 $this_file = 'options.php';
6 $parent_file = 'options-general.php';
8 wp_reset_vars(array('action'));
10 if ( !current_user_can('manage_options') )
11 wp_die(__('Cheatin’ uh?'));
18 check_admin_referer('update-options');
20 if ( !$_POST['page_options'] ) {
21 foreach ( (array) $_POST as $key => $value) {
22 if ( !in_array($key, array('_wpnonce', '_wp_http_referer')) )
26 $options = explode(',', stripslashes($_POST['page_options']));
30 foreach ($options as $option) {
31 $option = trim($option);
32 $value = $_POST[$option];
33 if(!is_array($value)) $value = trim($value);
34 $value = stripslashes_deep($value);
35 update_option($option, $value);
39 $goback = add_query_arg('updated', 'true', wp_get_referer());
44 include('admin-header.php'); ?>
47 <h2><?php _e('All Settings'); ?></h2>
48 <form name="form" action="options.php" method="post" id="all-options">
49 <?php wp_nonce_field('update-options') ?>
50 <input type="hidden" name="action" value="update" />
51 <table class="form-table">
53 $options = $wpdb->get_results("SELECT * FROM $wpdb->options ORDER BY option_name");
55 foreach ( (array) $options as $option) :
57 $option->option_name = attribute_escape($option->option_name);
58 if ( is_serialized($option->option_value) ) {
59 if ( is_serialized_string($option->option_value) ) {
60 // this is a serialized string, so we should display it
61 $value = maybe_unserialize($option->option_value);
62 $options_to_update[] = $option->option_name;
63 $class = 'all-options';
65 $value = 'SERIALIZED DATA';
66 $disabled = ' disabled="disabled"';
67 $class = 'all-options disabled';
70 $value = $option->option_value;
71 $options_to_update[] = $option->option_name;
72 $class = 'all-options';
76 <th scope='row'>$option->option_name</th>
79 if (strpos($value, "\n") !== false) echo "<textarea class='$class' name='$option->option_name' id='$option->option_name' cols='30' rows='5'>" . wp_specialchars($value) . "</textarea>";
80 else echo "<input class='$class' type='text' name='$option->option_name' id='$option->option_name' size='30' value='" . attribute_escape($value) . "'$disabled />";
87 <?php $options_to_update = implode(',', $options_to_update); ?>
88 <p class="submit"><input type="hidden" name="page_options" value="<?php echo $options_to_update; ?>" /><input type="submit" name="Update" value="<?php _e('Save Changes') ?>" /></p>
97 include('admin-footer.php');