WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/26/2014 11:57:10 PM (6 years ago)
Author:
nacin
Message:

Add a $default argument to get_query_var() and WP_Query::get(). fixes #16471.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/query.php

    r27067 r27304  
    7878        }
    7979    }
     80
     81    /**
     82     * @ticket 16471
     83     */
     84    function test_default_query_var() {
     85        $query = new WP_Query;
     86        $this->assertEquals( '', $query->get( 'nonexistent' ) );
     87        $this->assertFalse( $query->get( 'nonexistent', false ) );
     88        $this->assertTrue( $query->get( 'nonexistent', true ) );
     89    }
    8090}
Note: See TracChangeset for help on using the changeset viewer.