apply_filters( 'the_password_form', string $output, WP_Post $post, string $invalid_password )
- Since
- 2.7.0, 5.8.0, 6.8.0
Filters the HTML output for the protected post password form.
Description
If modifying the password field, please note that the WordPress database schema limits the password field to 255 characters regardless of the value of the minlength or maxlength attributes or other validation that may be added to the input.
Compatibility
- WordPress
- since 6.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$outputstring- The password form HTML output.
$postWP_Post- Post object.
$invalid_passwordstring- The invalid password message.
Where this hook fires · 1
wp-includes/post-template.php:1847get_the_password_form()
Source code
* @since 6.8.0 Added the `$invalid_password` parameter. * * @param string $output The password form HTML output. * @param WP_Post $post Post object. * @param string $invalid_password The invalid password message. */ return apply_filters( 'the_password_form', $output, $post, $invalid_password );} /** * Determines whether the current post uses a page template. * * This template tag allows you to determine if you are in a page template.Changelog
Introduced in 2.7.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
6.8.8
Parameter
$invalid_password added.verified against source6.8.0
Added the
$invalid_password parameter.from the docblock5.8.0
Added the
$post parameter.from the docblock2.7.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.