get_following_count((int) $user_id) : 0;
$follower_count = $follow_instance ? (int) $follow_instance->get_follower_count((int) $user_id) : 0;
$list = ['items' => [], 'total' => 0, 'total_pages' => 1];
if ($follow_instance) {
$list = $follow_sub === 'followers'
? $follow_instance->get_followers((int) $user_id, $follow_page, (int) $per_page)
: $follow_instance->get_following((int) $user_id, $follow_page, (int) $per_page);
}
$items = is_array($list['items'] ?? null) ? $list['items'] : [];
$total_pages = max(1, (int) ($list['total_pages'] ?? 1));
?>