]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/options-head.php
WordPress 4.1
[autoinstalls/wordpress.git] / wp-admin / options-head.php
index 579da0a3af206624db6488c6d9779a473c842ab1..1c706c87d7296cdc94df67f4d80ea307a263bf46 100644 (file)
@@ -1,24 +1,18 @@
 <?php
+/**
+ * WordPress Options Header.
+ *
+ * Displays updated message, if updated variable is part of the URL query.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
 
-$wpvarstoreset = array('action','standalone', 'option_group_id');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
-       $wpvar = $wpvarstoreset[$i];
-       if (!isset($$wpvar)) {
-               if (empty($_POST["$wpvar"])) {
-                       if (empty($_GET["$wpvar"])) {
-                               $$wpvar = '';
-                       } else {
-                               $$wpvar = $_GET["$wpvar"];
-                       }
-               } else {
-                       $$wpvar = $_POST["$wpvar"];
-               }
-       }
-}
-?>
+wp_reset_vars( array( 'action' ) );
 
-<br clear="all" />
+if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
+       // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
+       add_settings_error('general', 'settings_updated', __('Settings saved.'), 'updated');
+}
 
-<?php if (isset($_GET['updated'])) : ?>
-<div id="message" class="updated fade"><p><strong><?php _e('Options saved.') ?></strong></p></div>
-<?php endif; ?>
\ No newline at end of file
+settings_errors();