From 7e1690bf87317b51d3e8f2a060537cf7adcbda37 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 26 Apr 2021 15:36:55 +0000 Subject: [PATCH] Posts, Post Types: Pass the post object to `the_password_form` filter. Props silb3r. Fixes #29008. git-svn-id: https://develop.svn.wordpress.org/trunk@50791 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index 3f7aaf1a97..64df897518 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -876,7 +876,7 @@ function post_password_required( $post = null ) { * * @param bool $required Whether the user needs to supply a password. True if password has not been * provided or is incorrect, false if password has been supplied or is not required. - * @param WP_Post $post Post data. + * @param WP_Post $post Post object. */ return apply_filters( 'post_password_required', $required, $post ); } @@ -1643,7 +1643,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals * Filters a retrieved attachment page link. * * @since 2.7.0 - * @since 5.1.0 Added the $attr parameter. + * @since 5.1.0 Added the `$attr` parameter. * * @param string $link_html The page link HTML output. * @param int $id Post ID. @@ -1734,10 +1734,12 @@ function get_the_password_form( $post = 0 ) { * size attribute in the form input. * * @since 2.7.0 + * @since 5.8.0 Added the `$post` parameter. * - * @param string $output The password form HTML output. + * @param string $output The password form HTML output. + * @param WP_Post $post Post object. */ - return apply_filters( 'the_password_form', $output ); + return apply_filters( 'the_password_form', $output, $post ); } /**