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

git-svn-id: https://develop.svn.wordpress.org/trunk@19733 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave 2012-01-13 18:15:55 +00:00
parent d58286e998
commit 2b4d4a1ec1
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 );
}
}