function twenty_twenty_one_password_form( $output,
$post = 0
) { $post =
get_post( $post );
$label = 'pwbox-' .
( empty( $post->ID
) ?
wp_rand() :
$post->ID
);
$output = '<p class="post-password-message">' .
esc_html__( 'This content is password protected. Please enter a password to view.', 'twentytwentyone'
) . '</p>
<form action="' .
esc_url( site_url( 'wp-login.php?action=postpass', 'login_post'
) ) . '" class="post-password-form" method="post">
<label class="post-password-form__label" for="' .
esc_attr( $label ) . '">' .
esc_html_x( 'Password', 'Post password form', 'twentytwentyone'
) . '</label><input class="post-password-form__input" name="post_password" id="' .
esc_attr( $label ) . '" type="password" spellcheck="false" size="20" /><input type="submit" class="post-password-form__submit" name="' .
esc_attr_x( 'Submit', 'Post password form', 'twentytwentyone'
) . '" value="' .
esc_attr_x( 'Enter', 'Post password form', 'twentytwentyone'
) . '" /></form>
';
return $output;
}add_filter( 'the_password_form', 'twenty_twenty_one_password_form', 10, 2
);
/**
* Filters the list of attachment image attributes.
*
* @since Twenty Twenty-One 1.0
*
* @param string[] $attr Array of attribute values for the image markup, keyed by attribute name.
* See wp_get_attachment_image().
* @param WP_Post $attachment Image attachment post.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @return string[] The filtered attributes for the image markup.
*/