Changeset 36329
- Timestamp:
- 01/16/2016 10:13:27 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r36321 r36329 373 373 } 374 374 375 if ( post_password_required( ) ) {375 if ( post_password_required( $post ) ) { 376 376 return __( 'There is no excerpt because this is a protected post.' ); 377 377 } -
trunk/tests/phpunit/tests/post/output.php
r36320 r36329 200 200 /** 201 201 * @ticket 27246 202 * @ticket 35486 202 203 */ 203 204 public function test_the_excerpt_password_protected_post() { 204 $GLOBALS['post'] = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt', 'post_password' => '1234' ) ); 205 $post = self::factory()->post->create_and_get( array( 'post_excerpt' => 'Post excerpt', 'post_password' => '1234' ) ); 206 $this->assertSame( 'There is no excerpt because this is a protected post.', get_the_excerpt( $post ) ); 207 208 $GLOBALS['post'] = $post; 205 209 $this->assertSame( "<p>There is no excerpt because this is a protected post.</p>\n", get_echo( 'the_excerpt' ) ); 206 $this->assertSame( 'There is no excerpt because this is a protected post.', get_the_excerpt() );207 210 } 208 211
Note: See TracChangeset
for help on using the changeset viewer.