Skip to content

Commit

Permalink
Prevent "Undefined index: settings-updated" notice in settings_errors…
Browse files Browse the repository at this point in the history
…(). Props garyc40. Fixes #19377.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
duck_ committed Jan 13, 2012
1 parent 88d3fe4 commit cd43f96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wp-admin/includes/template.php
Expand Up @@ -1252,11 +1252,13 @@ function get_settings_errors( $setting = '', $sanitize = false ) {
*/
function settings_errors( $setting = '', $sanitize = false, $hide_on_update = false ) {

if ($hide_on_update AND $_GET['settings-updated']) return;
if ( $hide_on_update && ! empty( $_GET['settings-updated'] ) )
return;

$settings_errors = get_settings_errors( $setting, $sanitize );

if ( !is_array($settings_errors) ) return;
if ( ! is_array( $settings_errors ) )
return;

$output = '';
foreach ( $settings_errors as $key => $details ) {
Expand Down Expand Up @@ -1829,4 +1831,4 @@ function convert_to_screen( $hook_name ) {
}

return WP_Screen::get( $hook_name );
}
}

0 comments on commit cd43f96

Please sign in to comment.