Let get_the_date() accept a post object.

props tanner-m, adamsilverstein, bigdawggi.
fixes #13771.


git-svn-id: https://develop.svn.wordpress.org/trunk@27380 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2014-03-03 17:59:11 +00:00
parent 1b41eea7c7
commit 260b7f08ca
2 changed files with 26 additions and 7 deletions

View File

@@ -865,4 +865,12 @@ class Tests_Post extends WP_UnitTestCase {
$this->assertEquals( 9, $after_trash_counts->publish );
$this->assertNotEquals( $initial_counts->publish, $after_trash_counts->publish );
}
/**
* @ticket 13771
*/
function test_get_the_date_with_id() {
$post_id = $this->factory->post->create( array( 'post_date' => '2014-03-01 16:35:00' ) );
$this->assertEquals( 'March 1, 2014', get_the_date( 'F j, Y', $post_id ) );
}
}