File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,8 @@ public function enqueue_admin_assets() {
146
146
$ validate = (
147
147
isset ( $ screen ->base ) &&
148
148
'post ' === $ screen ->base &&
149
- ( ! isset ( $ screen -> is_block_editor ) || ! $ screen ->is_block_editor ) &&
150
- in_array ( $ post ->post_type , AMP_Post_Type_Support::get_eligible_post_types (), true )
149
+ empty ( $ screen ->is_block_editor ) &&
150
+ in_array ( $ post ->post_type , AMP_Post_Type_Support::get_supported_post_types (), true )
151
151
);
152
152
153
153
if ( ! $ validate ) {
@@ -344,7 +344,7 @@ public function render_status( $post ) {
344
344
$ verify = (
345
345
isset ( $ post ->ID )
346
346
&&
347
- in_array ( $ post ->post_type , AMP_Post_Type_Support::get_eligible_post_types (), true )
347
+ in_array ( $ post ->post_type , AMP_Post_Type_Support::get_supported_post_types (), true )
348
348
&&
349
349
current_user_can ( 'edit_post ' , $ post ->ID )
350
350
);
Original file line number Diff line number Diff line change @@ -284,16 +284,11 @@ public function test_render_status() {
284
284
$ this ->assertStringContainsString ( $ no_support_notice , $ output );
285
285
}
286
286
287
- // Post type no longer supports AMP, so no status input.
287
+ // Post type no longer supports AMP, so no status input (and no mention of AMP at all) .
288
288
$ supported_post_types = array_diff ( AMP_Options_Manager::get_option ( Option::SUPPORTED_POST_TYPES ), [ 'post ' ] );
289
289
AMP_Options_Manager::update_option ( Option::SUPPORTED_POST_TYPES , $ supported_post_types );
290
290
$ output = get_echo ( [ $ this ->instance , 'render_status ' ], [ $ post ] );
291
- if ( Services::get ( 'dependency_support ' )->has_support_from_core () ) {
292
- $ this ->assertStringContainsString ( 'This post type is not ' , $ output );
293
- $ this ->assertStringNotContainsString ( $ checkbox_enabled , $ output );
294
- } else {
295
- $ this ->assertStringContainsString ( $ no_support_notice , $ output );
296
- }
291
+ $ this ->assertEmpty ( $ output );
297
292
$ supported_post_types [] = 'post ' ;
298
293
AMP_Options_Manager::update_option ( Option::SUPPORTED_POST_TYPES , $ supported_post_types );
299
294
You can’t perform that action at this time.
0 commit comments