Remove unnecessary checks before setting $wp_settings_* arrays. Adds unit test for setting a nonexistent variable to a multi-dimensional array.

Props scribu.
Fixes #17884.



git-svn-id: https://develop.svn.wordpress.org/trunk@25240 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor
2013-09-04 19:06:13 +00:00
parent 24bf60bb4f
commit d10b9d32a0
2 changed files with 13 additions and 19 deletions

View File

@@ -88,4 +88,15 @@ EOF;
EOF;
$this->assertEquals($expected, mask_input_value($in));
}
function test_setting_nonexistent_arrays() {
$page = 1;
$field = 'settings';
error_reporting( -1 );
$empty_array[$page][$field] = 'foo';
unset( $empty_array[$page]['bar']['baz'] );
}
}