function et_password_form() {
$pwbox_id = rand();
$form_output = sprintf(
‘<div class=”et_password_protected_form”>
<h1>%1$s</h1>
<p>%2$s:</p>
<form action=”%3$s” method=”post”>
<p><label for=”%4$s”>%5$s: </label><input name=”post_password” id=”%4$s” type=”password” size=”20″ maxlength=”20″ /></p>
<p><button type=”submit” class=”et_submit_button et_pb_button”>%6$s</button></p>
</form>
</div>’,
esc_html__( ‘Password Protected’, ‘Divi’ ),
esc_html__( ‘To view this protected post, enter the password below’, ‘Divi’ ),
esc_url( site_url( ‘wp-login.php?action=postpass’, ‘login_post’ ) ),
esc_attr( ‘pwbox-‘ . $pwbox_id ),
esc_html__( ‘Password’, ‘Divi’ ),
esc_html__( ‘Submit’, ‘Divi’ )
);
$output = sprintf(
‘<div class=”et_pb_section et_section_regular”>
<div class=”et_pb_row”>
<div class=”et_pb_column et_pb_column_4_4″>
%1$s
</div>
</div>
</div>’,
$form_output
);
return $output;
}
add_filter( ‘the_password_form’, ‘et_password_form’ );