mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Options: Pass the $passed_default parameter to the 'default_option_{$option} filter in add_option().
This was missed in [38910]. Props joehoyle, lucasstark. See #38176. Fixes #38930. git-svn-id: https://develop.svn.wordpress.org/trunk@39382 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -61,6 +61,18 @@ class Tests_Option_Registration extends WP_UnitTestCase {
|
||||
$this->assertEquals( 'Fuck Leukemia', get_option( 'test_default', 'Fuck Leukemia' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 38930
|
||||
*/
|
||||
public function test_add_option_with_no_options_cache() {
|
||||
register_setting( 'test_group', 'test_default', array(
|
||||
'default' => 'My Default :)',
|
||||
));
|
||||
wp_cache_delete( 'notoptions', 'options' );
|
||||
$this->assertTrue( add_option( 'test_default', 'hello' ) );
|
||||
$this->assertEquals( 'hello', get_option( 'test_default' ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedDeprecated register_setting
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user