mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Add a $default argument to get_query_var() and WP_Query::get(). fixes #16471.
git-svn-id: https://develop.svn.wordpress.org/trunk@27304 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -77,4 +77,14 @@ class Tests_Query extends WP_UnitTestCase {
|
||||
$this->assertEquals( get_the_ID(), $post_id );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 16471
|
||||
*/
|
||||
function test_default_query_var() {
|
||||
$query = new WP_Query;
|
||||
$this->assertEquals( '', $query->get( 'nonexistent' ) );
|
||||
$this->assertFalse( $query->get( 'nonexistent', false ) );
|
||||
$this->assertTrue( $query->get( 'nonexistent', true ) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user