Prevent "Undefined index: settings-updated" notice in settings_errors(). Props garyc40. Fixes #19377.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
duck_ 2012-01-13 18:15:55 +00:00
parent 88d3fe4445
commit cd43f96110
1 changed files with 5 additions and 3 deletions

View File

@ -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 ) {
@ -1829,4 +1831,4 @@ function convert_to_screen( $hook_name ) {
}
return WP_Screen::get( $hook_name );
}
}