Changeset 48819
- Timestamp:
- 08/18/2020 07:35:30 PM (5 years ago)
- Location:
- branches/5.5
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.5
-
branches/5.5/src/wp-includes/formatting.php
r48603 r48819 3809 3809 $raw_excerpt = $text; 3810 3810 3811 if ( '' === $text) {3811 if ( '' === trim( $text ) ) { 3812 3812 $post = get_post( $post ); 3813 3813 $text = get_the_content( '', false, $post ); -
branches/5.5/tests/phpunit/tests/formatting/WpTrimExcerpt.php
r46586 r48819 67 67 } 68 68 } 69 70 /** 71 * @ticket 51042 72 */ 73 public function test_should_generate_excerpt_for_empty_values() { 74 $post = self::factory()->post->create( 75 array( 76 'post_content' => 'Post content', 77 ) 78 ); 79 80 $this->assertSame( 'Post content', wp_trim_excerpt( '', $post ) ); 81 $this->assertSame( 'Post content', wp_trim_excerpt( null, $post ) ); 82 $this->assertSame( 'Post content', wp_trim_excerpt( false, $post ) ); 83 } 69 84 }
Note: See TracChangeset
for help on using the changeset viewer.