Custom Password form

I'm using the following in my functions.php to replace the default password form with a custom one.

add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
global $post;
$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
$output = '<form class=&quot;protected-post-form&quot; action=&quot;; method=&quot;post&quot;>
<p>' . __( &quot;Some CY4OR Resources are protected. Please enter your password or complete the form below to request access.&quot; ) . '</p>
<label class=&quot;pass-label&quot; for=&quot;' . $label . '&quot;>' . __( &quot;Password&quot; ) . ' </label><input name=&quot;post_password&quot; id=&quot;' . $label . '&quot; type=&quot;password&quot; /><input type=&quot;submit&quot; name=&quot;Submit&quot; class=&quot;button&quot; value=&quot;' . esc_attr__( &quot;Submit&quot; ) . '&quot; /></form>
return $output;

It works as it should when an entire post/page is password protected but when using the Password Protect plugin to hide just some of the content within a post it uses the default WP password form.

How can I hook into my custom form for this plugin?