Changeset 36253
- Timestamp:
- 01/10/2016 06:27:06 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/post.php (modified) (1 diff)
-
tests/phpunit/tests/admin/includesPost.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r36143 r36253 4292 4292 */ 4293 4293 function get_page_uri( $page ) { 4294 $page = get_post( $page ); 4294 if ( ! $page instanceof WP_Post ) { 4295 $page = get_post( $page ); 4296 } 4295 4297 4296 4298 if ( ! $page ) -
trunk/tests/phpunit/tests/admin/includesPost.php
r36113 r36253 455 455 } 456 456 457 /** 458 * @ticket 35368 459 */ 460 public function test_get_sample_permalink_should_respect_hierarchy_of_draft_pages() { 461 $this->set_permalink_structure( '/%postname%/' ); 462 463 $parent = self::factory()->post->create( array( 464 'post_type' => 'page', 465 'post_title' => 'Parent Page', 466 ) ); 467 468 $child = self::factory()->post->create( array( 469 'post_type' => 'page', 470 'post_title' => 'Child Page', 471 'post_parent' => $parent, 472 'post_status' => 'draft', 473 ) ); 474 475 $actual = get_sample_permalink( $child ); 476 $this->assertSame( home_url() . '/parent-page/%pagename%/', $actual[0] ); 477 $this->assertSame( 'child-page', $actual[1] ); 478 } 479 457 480 public function test_post_exists_should_match_title() { 458 481 $p = self::factory()->post->create( array(
Note: See TracChangeset
for help on using the changeset viewer.