apply_filters( 'the_password_form_incorrect_password', string $text, WP_Post $post )
- Since
- 6.8.0
Filters the invalid password message shown on password-protected posts.
Description
The filter is only applied if the post is password-protected.
Compatibility
- WordPress
- since 6.8.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in 4 of the 5 tracked releases, added in 6.8.0.
Parameters
$textstring- The message shown to users when entering an invalid password.
$postWP_Post- Post object.
Where this hook fires · 1
wp-includes/post-template.php:1799get_the_password_form()
Source code
* * @since 6.8.0 * * @param string $text The message shown to users when entering an invalid password. * @param WP_Post $post Post object. */ $invalid_password = apply_filters( 'the_password_form_incorrect_password', __( 'Invalid password.' ), $post ); $invalid_password_html = '<div class="post-password-form-invalid-password" role="alert"><p id="error-' . $field_id . '">' . $invalid_password . '</p></div>'; $aria = ' aria-describedby="error-' . $field_id . '"'; $class = ' password-form-error'; } if ( ! empty( $post->ID ) ) {Changelog
Introduced in 6.8.0. Unchanged from 6.8.8 through 7.1.0.
Signature, return type and hooks compared across 4 parsed releases.
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.