Skip to content

Commit d21ebdc

Browse files
authored
Merge branch 'WordPress:trunk' into trunk
2 parents 266e997 + e4024b8 commit d21ebdc

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/wp-includes/post-template.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,9 +1809,23 @@ function get_the_password_form( $post = 0 ) {
18091809
);
18101810
}
18111811

1812+
$button_class = '';
1813+
$button_wrapper_open = '';
1814+
$button_wrapper_close = '';
1815+
1816+
if ( wp_is_block_theme() ) {
1817+
$button_class = ' class="wp-block-button__link ' . wp_theme_get_element_class_name( 'button' ) . '"';
1818+
$button_wrapper_open = '<span class="wp-block-button">';
1819+
$button_wrapper_close = '</span>';
1820+
1821+
if ( wp_style_is( 'wp-block-button', 'registered' ) ) {
1822+
wp_enqueue_style( 'wp-block-button' );
1823+
}
1824+
}
1825+
18121826
$output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="post-password-form' . $class . '" method="post">' . $redirect_field . $invalid_password_html . '
18131827
<p>' . __( 'This content is password-protected. To view it, please enter the password below.' ) . '</p>
1814-
<p><label for="' . $field_id . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $field_id . '" type="password" spellcheck="false" required size="20"' . $aria . ' /></label> <input type="submit" name="Submit" value="' . esc_attr_x( 'Enter', 'post password form' ) . '" /></p></form>
1828+
<p><label for="' . $field_id . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $field_id . '" type="password" spellcheck="false" required size="20"' . $aria . ' /></label> ' . $button_wrapper_open . '<input type="submit" name="Submit"' . $button_class . ' value="' . esc_attr_x( 'Enter', 'post password form' ) . '" />' . $button_wrapper_close . '</p></form>
18151829
';
18161830

18171831
/**

0 commit comments

Comments
 (0)