Changeset 53858
- Timestamp:
- 08/08/2022 08:20:43 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r53799 r53858 426 426 if ( ! is_string( $post ) ) { 427 427 $wp_post = get_post( $post ); 428 if ( $wp_post instanceof WP_Post ) { 429 $post = $wp_post->post_content; 430 } 428 429 if ( ! $wp_post instanceof WP_Post ) { 430 return false; 431 } 432 433 $post = $wp_post->post_content; 431 434 } 432 435 -
trunk/tests/phpunit/tests/blocks/register.php
r53718 r53858 554 554 555 555 /** 556 * Tests that `has_blocks()` returns `false` with an invalid post. 557 * 558 * @ticket 55705 559 * 560 * @covers ::has_blocks 561 */ 562 public function test_has_blocks_with_invalid_post() { 563 $a_post = (object) array( 564 'ID' => 55705, 565 'filter' => 'display', 566 ); 567 $this->assertFalse( has_blocks( $a_post ) ); 568 } 569 570 /** 556 571 * @ticket 49615 557 572 */
Note: See TracChangeset
for help on using the changeset viewer.