diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php
index 76d937cd6c..2f64ae5344 100644
a
|
b
|
function get_oembed_response_data( $post, $width ) { |
506 | 506 | return false; |
507 | 507 | } |
508 | 508 | |
509 | | if ( 'publish' !== get_post_status( $post ) ) { |
| 509 | if ( ! get_post_status_object( get_post_status( $post ) )->public ) { |
510 | 510 | return false; |
511 | 511 | } |
512 | 512 | |
diff --git a/tests/phpunit/tests/oembed/getResponseData.php b/tests/phpunit/tests/oembed/getResponseData.php
index de96211f87..5966c8e250 100644
a
|
b
|
class Tests_oEmbed_Response_Data extends WP_UnitTestCase { |
128 | 128 | $this->assertFalse( get_oembed_response_data( $post, 100 ) ); |
129 | 129 | } |
130 | 130 | |
| 131 | /** |
| 132 | * @ticket 47574 |
| 133 | */ |
| 134 | function test_getoembed_response_data_with_public_true_custom_post_status() { |
| 135 | // Custom status with public=true. |
| 136 | register_post_status( 'public', array( 'public' => true ) ); |
| 137 | |
| 138 | $post = self::factory()->post->create_and_get( |
| 139 | array( |
| 140 | 'post_status' => 'public', |
| 141 | ) |
| 142 | ); |
| 143 | |
| 144 | $this->assertNotFalse( get_oembed_response_data( $post, 100 ) ); |
| 145 | |
| 146 | _unregister_post_status( 'public' ); |
| 147 | } |
| 148 | |
| 149 | /** |
| 150 | * @ticket 47574 |
| 151 | */ |
| 152 | function test_getoembed_response_data_with_public_false_custom_post_status() { |
| 153 | // Custom status with public=false. |
| 154 | register_post_status( 'privatfoo', array( 'public' => false ) ); |
| 155 | |
| 156 | $post = self::factory()->post->create_and_get( |
| 157 | array( |
| 158 | 'post_status' => 'privatfoo', |
| 159 | ) |
| 160 | ); |
| 161 | |
| 162 | $this->assertFalse( get_oembed_response_data( $post, 100 ) ); |
| 163 | |
| 164 | _unregister_post_status( 'privatfoo' ); |
| 165 | } |
| 166 | |
131 | 167 | function test_get_oembed_response_data_maxwidth_too_high() { |
132 | 168 | $post = self::factory()->post->create_and_get(); |
133 | 169 | |