-
Notifications
You must be signed in to change notification settings - Fork 16
friends_override_author_name
Alex Kirk edited this page Oct 16, 2024
·
18 revisions
Allows overriding the authorname for a post. The original author will still be displayed.
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.
apply_filters( 'friends_override_author_name', '', $author_name, get_the_id() )
apply_filters( 'friends_override_author_name', '', $author_name, get_the_id() )
apply_filters( 'friends_override_author_name', '', $author_name, $_post->ID )
apply_filters( 'friends_override_author_name', '', $args['author']->display_name, $args['post']->ID )
apply_filters( 'friends_override_author_name', '', $args['author']->display_name, $args['post']->ID )