get_the_author_{$field}
Filter HookDescription
Filters the value of the requested user metadata. The filter name is dynamic and depends on the $field parameter of the function.Hook Information
File Location |
wp-includes/author-template.php
View on GitHub
|
Hook Type | Filter |
Line Number | 190 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$value
|
The value of the metadata. |
int
|
$user_id
|
The user ID for the value. |
int|false
|
$original_user_id
|
The original user ID, as passed to the function. |
Usage Examples
Basic Usage
<?php
// Hook into get_the_author_{$field}
add_filter('get_the_author_{$field}', 'my_custom_filter', 10, 3);
function my_custom_filter($value, $user_id, $original_user_id) {
// Your custom filtering logic here
return $value;
}
Source Code Context
wp-includes/author-template.php:190
- How this hook is used in WordPress core
<?php
185 *
186 * @param string $value The value of the metadata.
187 * @param int $user_id The user ID for the value.
188 * @param int|false $original_user_id The original user ID, as passed to the function.
189 */
190 return apply_filters( "get_the_author_{$field}", $value, $user_id, $original_user_id );
191 }
192
193 /**
194 * Outputs the field from the user's DB object. Defaults to current post's author.
195 *
PHP Documentation
<?php
/**
* Filters the value of the requested user metadata.
*
* 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 for the value.
* @param int|false $original_user_id The original user ID, as passed to the function.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/author-template.php
Related Hooks
Related hooks will be displayed here in future updates.