the_password_form_incorrect_password
Filters the invalid password message shown on password-protected posts. The filter is only applied if the post is password-protected.
Usage
add_filter( 'the_password_form_incorrect_password', 'wp_kama_the_password_form_incorrect_filter', 10, 2 );
/**
* Function for `the_password_form_incorrect_password` filter-hook.
*
* @param string $text The message shown to users when entering an invalid password.
* @param WP_Post $post Post object.
*
* @return string
*/
function wp_kama_the_password_form_incorrect_filter( $text, $post ){
// filter...
return $text;
}
- $text(string)
- The message shown to users when entering an invalid password.
- $post(WP_Post)
- Post object.
Changelog
| Since 6.8.0 | Introduced. |
Where the hook is called
the_password_form_incorrect_password
wp-includes/post-template.php 1796
$invalid_password = apply_filters( 'the_password_form_incorrect_password', __( 'Invalid password.' ), $post );