diff --git a/includes/class-amp-post-type-support.php b/includes/class-amp-post-type-support.php index 5c77b0b2acb..36036771792 100644 --- a/includes/class-amp-post-type-support.php +++ b/includes/class-amp-post-type-support.php @@ -88,10 +88,6 @@ public static function get_support_errors( $post ) { $errors[] = 'post-type-support'; } - if ( post_password_required( $post ) ) { - $errors[] = 'password-protected'; - } - /** * Filters whether to skip the post from AMP. * diff --git a/includes/templates/class-amp-post-template.php b/includes/templates/class-amp-post-template.php index a366bc98405..28e33c5e655 100644 --- a/includes/templates/class-amp-post-template.php +++ b/includes/templates/class-amp-post-template.php @@ -322,7 +322,7 @@ private function build_post_comments_data() { */ private function build_post_content() { $amp_content = new AMP_Content( - $this->post->post_content, + post_password_required( $this->post ) ? get_the_password_form( $this->post ) : $this->post->post_content, amp_get_content_embed_handlers( $this->post ), amp_get_content_sanitizers( $this->post ), [ diff --git a/tests/php/test-class-amp-post-type-support.php b/tests/php/test-class-amp-post-type-support.php index de9d58d03d9..c1609bd3573 100644 --- a/tests/php/test-class-amp-post-type-support.php +++ b/tests/php/test-class-amp-post-type-support.php @@ -104,12 +104,6 @@ public function test_get_support_error() { add_post_type_support( 'book', AMP_Post_Type_Support::SLUG ); $this->assertEmpty( AMP_Post_Type_Support::get_support_errors( $book_id ) ); - // Password-protected. - add_filter( 'post_password_required', '__return_true' ); - $this->assertEquals( [ 'password-protected' ], AMP_Post_Type_Support::get_support_errors( $book_id ) ); - remove_filter( 'post_password_required', '__return_true' ); - $this->assertEmpty( AMP_Post_Type_Support::get_support_errors( $book_id ) ); - // Skip-post. add_filter( 'amp_skip_post', '__return_true' ); $this->assertEquals( [ 'skip-post' ], AMP_Post_Type_Support::get_support_errors( $book_id ) );