protected function can_access_password_content( $post, $request ) {
		if ( empty( $post->post_password ) ) {
			// No filter required.
			return false;
		}

		// Edit context always gets access to password-protected posts.
		if ( 'edit' === $request['context'] ) {
			return true;
		}

		// No password, no auth.
		if ( empty( $request['password'] ) ) {
			return false;
		}

		// Double-check the request password.
		return hash_equals( $post->post_password, $request['password'] );
	}
protected function can_access_password_content( $post, $request ) {
		if ( empty( $post->post_password ) ) {
			// No filter required.
			return false;
		}

		// Edit context always gets access to password-protected posts.
		if ( 'edit' === $request['context'] ) {
			return true;
		}

		// No password, no auth.
		if ( empty( $request['password'] ) ) {
			return false;
		}

		// Double-check the request password.
		return hash_equals( $post->post_password, $request['password'] );
	}
protected function can_access_password_content ( $ post , $ request ) { if ( empty ( $ post -> post_password ) ) { // No filter required. return false ; } // Edit context always gets access to password-protected posts. if ( 'edit' === $ request [ 'context' ] ) { return true ; } // No password, no auth. if ( empty ( $ request [ 'password' ] ) ) { return false ; } // Double-check the request password. return hash_equals ( $ post -> post_password , $ request [ 'password' ] ) ; }
Can the user access password-protected content?

This method determines whether we need to override the regular password
check in core with a filter.

@param WP_Post         $post    Post to check against.
@param WP_REST_Request $request Request data to check.
@return bool True if the user can access password-protected content, false otherwise.
Can the user access password - protected content?