Skip to content

Commit

Permalink
Fix post count on friends-list
Browse files Browse the repository at this point in the history
  • Loading branch information
akirk committed Oct 6, 2024
1 parent ac9a189 commit e90ae06
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/class-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2687,8 +2687,14 @@ public static function user_list_custom_column( $output, $column_name, $user_id
if ( 'friends_posts' !== $column_name ) {
return $output;
}
$numposts = count_user_posts( $user_id, apply_filters( 'friends_frontend_post_types', array( 'post' ) ) );
$user = User::get_user_by_id( $user_id );
if ( ! $user ) {
return $output;
}

$post_status_counts = $user->get_post_count_by_post_format();
$numposts = array_sum( $post_status_counts );

return sprintf(
'<a href="%s" class="edit"><span aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
$user ? $user->get_local_friends_page_url() : "edit.php?author={$user_id}",
Expand Down

0 comments on commit e90ae06

Please sign in to comment.