-
Notifications
You must be signed in to change notification settings - Fork 17
friends_override_author_name
Alex Kirk edited this page Apr 5, 2024
·
18 revisions
add_filter(
'friends_override_author_name',
function (
string $override_author_name,
string $author_name,
int $post_id
) {
// Your code here
return $override_author_name;
},
10,
3
);
Allows overriding the authorname for a post.
Example:
add_filter( 'friends_override_author_name', function( $override_author_name, $author_name, $post_id ) {
if ( ! $override_author_name ) { // Only override if not already overridden.
$override_author_name = get_post_meta( $post_id, 'author', true );
}
return $override_author_name;
}, 10, 3 );
-
string
$override_author_name
The author name to override with. -
string
$author_name
The author name. -
int
$post_id
The post ID.