wppaste
WordPress

apply_filters( 'the_password_form', string $output, WP_Post $post )

Since
2.7.0, 5.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 5.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.

Where this hook fires · 1

  • wp-includes/post-template.php:1791get_the_password_form()

Source code

	 * @since 2.7.0	 * @since 5.8.0 Added the `$post` parameter.	 *	 * @param string  $output The password form HTML output.	 * @param WP_Post $post   Post object.	 */	return apply_filters( 'the_password_form', $output, $post );} /** * 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.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.8.8
Parameter $invalid_password added.verified against source
5.8.0
Added the $post parameter.from the docblock
2.7.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 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.