mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Posts: Allow get_page_uri() to be called without a $page argument.
`get_page_uri()` can now be called without an argument, which will return the page URI for the current post in the loop. Props pollett. Fixes #26284. git-svn-id: https://develop.svn.wordpress.org/trunk@37345 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @group post
|
||||
*/
|
||||
class Tests_Post_getPageUri extends WP_UnitTestCase {
|
||||
|
||||
function test_get_page_uri_without_argument() {
|
||||
$post_id = self::factory()->post->create(array(
|
||||
'post_title' => 'Blood Orange announces summer tour dates',
|
||||
'post_name' => 'blood-orange-announces-summer-tour-dates',
|
||||
));
|
||||
$post = get_post( $post_id );
|
||||
$this->go_to( get_permalink( $post_id ) );
|
||||
$this->assertEquals( 'blood-orange-announces-summer-tour-dates', get_page_uri() );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user