From 51a892f975fa1a59e810534e7c7157147b7e5d15 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 25 May 2015 13:06:25 +0000 Subject: [PATCH] Pass the original `$user_id` variable to the filter in `get_the_author_meta()`. Props dlh, chriscct7. Fixes #32481. Built from https://develop.svn.wordpress.org/trunk@32594 git-svn-id: http://core.svn.wordpress.org/trunk@32564 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/author-template.php | 10 +++++++--- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/author-template.php b/wp-includes/author-template.php index f9a7534b6f..36d08bc81e 100644 --- a/wp-includes/author-template.php +++ b/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 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index d584f38e65..4e9ef527d8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32593'; +$wp_version = '4.3-alpha-32594'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.