Changeset 52434 for trunk/src/wp-includes/blocks/post-content.php
- Timestamp:
- 01/04/2022 05:37:25 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/post-content.php
r51344 r52434 37 37 $seen_ids[ $post_id ] = true; 38 38 39 // Check is needed for backward compatibility with third-party plugins 40 // that might rely on the `in_the_loop` check; calling `the_post` sets it to true. 39 41 if ( ! in_the_loop() && have_posts() ) { 40 42 the_post(); 41 43 } 42 44 43 $content = get_the_content( null, false, $post_id ); 45 // When inside the main loop, we want to use queried object 46 // so that `the_preview` for the current post can apply. 47 // We force this behavior by omitting the third argument (post ID) from the `get_the_content`. 48 $content = get_the_content( null, false ); 44 49 /** This filter is documented in wp-includes/post-template.php */ 45 50 $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) );
Note: See TracChangeset
for help on using the changeset viewer.