mirror of
https://github.com/WordPress/WordPress.git
synced 2024-09-29 15:47:38 +02:00
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:
parent
88d3fe4445
commit
cd43f96110
@ -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 );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user