From abb1cef39588636792efc9f2d7af48deee09cc58 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 25 May 2015 13:05:21 +0000 Subject: [PATCH] Pass the original `$user_id` variable to the filter in `get_the_author_meta()`. Props dlh, chriscct7. Fixes #32481. git-svn-id: https://develop.svn.wordpress.org/trunk@32594 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/author-template.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/author-template.php b/src/wp-includes/author-template.php index f9a7534b6f..36d08bc81e 100644 --- a/src/wp-includes/author-template.php +++ b/src/wp-includes/author-template.php @@ -111,6 +111,8 @@ function the_modified_author() { * @return string The author's field from the current author's DB object. */ function get_the_author_meta( $field = '', $user_id = false ) { + $original_user_id = $user_id; + if ( ! $user_id ) { global $authordata; $user_id = isset( $authordata->ID ) ? $authordata->ID : 0; @@ -129,11 +131,13 @@ function get_the_author_meta( $field = '', $user_id = false ) { * The filter name is dynamic and depends on the $field parameter of the function. * * @since 2.8.0 + * @since 4.3.0 The `$original_user_id` parameter was added. * - * @param string $value The value of the metadata. - * @param int $user_id The user ID. + * @param string $value The value of the metadata. + * @param int $user_id The user ID for the value. + * @param int|bool $original_user_id The original user ID, as passed to the function. */ - return apply_filters( 'get_the_author_' . $field, $value, $user_id ); + return apply_filters( 'get_the_author_' . $field, $value, $user_id, $original_user_id ); } /**