From e41fe518204204545ff058143fabe298c314e972 Mon Sep 17 00:00:00 2001 From: Mohsin Rasool Date: Fri, 12 Apr 2019 20:20:30 +0500 Subject: [PATCH] Fixes Online and Maximum Online Players Online and Maximum Online players are showing "Array" instead of a number. This commit fixes the issue by using the "value" attribute of the array. --- core/shortcodes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/shortcodes.php b/core/shortcodes.php index 9ed36f5..64399bc 100644 --- a/core/shortcodes.php +++ b/core/shortcodes.php @@ -43,8 +43,8 @@ function grohsfabian_game_servers_short($atts, $message = null) { case 'server_name' : $content .= $server->server_name; break; case 'server_status' : $content .= (($status) ? __('Online', 'game-server-status') : __('Offline', 'game-server-status')); break; case 'server_address' : $content .= $server->server_ip . ':' . $server->server_connection_port; break; - case 'server_online_players' : $content .= $server_info['general']['online_players']; break; - case 'server_maximum_online_players' : $content .= $server_info['general']['maximum_online_players']; break; + case 'server_online_players' : $content .= $server_info['general']['online_players']['value']; break; + case 'server_maximum_online_players' : $content .= $server_info['general']['maximum_online_players']['value']; break; default: $content .= '' . __('Name:', 'game-server-status') . ' ' . $server->server_name . '
'; @@ -69,4 +69,4 @@ function grohsfabian_game_servers_short($atts, $message = null) { /* Register the ShortCodes */ add_shortcode('game-servers', 'grohsfabian_game_servers_short'); -?> \ No newline at end of file +?>