Ticket #41426: 41426.4.diff
| File 41426.4.diff, 1.5 KB (added by , 9 years ago) |
|---|
-
src/wp-includes/post-template.php
382 382 } 383 383 384 384 if ( post_password_required( $post ) ) { 385 return __( 'There is no excerpt because this is a protected post.' );385 return '<span class="post-password-state">' . __( 'There is no excerpt because this is a protected post.' ) . '</span>'; 386 386 } 387 387 388 388 /** -
tests/phpunit/tests/post/getTheExcerpt.php
38 38 */ 39 39 public function test_the_excerpt_password_protected_post() { 40 40 $post = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt', 'post_password' => '1234' ) ); 41 $this->assertSame( ' There is no excerpt because this is a protected post.', get_the_excerpt( $post ) );41 $this->assertSame( '<span class="post-password-state">There is no excerpt because this is a protected post.</span>', get_the_excerpt( $post ) ); 42 42 43 43 $GLOBALS['post'] = $post; 44 $this->assertSame( "<p> There is no excerpt because this is a protected post.</p>\n", get_echo( 'the_excerpt' ) );44 $this->assertSame( "<p><span class=\"post-password-state\">There is no excerpt because this is a protected post.</span></p>\n", get_echo( 'the_excerpt' ) ); 45 45 } 46 46 47 47 /**
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)