From 17fae7605824d8cbccd18ab698656f8a5a884f54 Mon Sep 17 00:00:00 2001 From: pronob1010 Date: Thu, 29 Aug 2024 12:31:07 +0600 Subject: [PATCH] fix: note visibility issue --- .../views/shortcode/conversation-details.php | 2 +- src/Conversations/Conversation.php | 47 ++++++++++--------- 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/includes/views/shortcode/conversation-details.php b/includes/views/shortcode/conversation-details.php index 404afd1..8a754e5 100644 --- a/includes/views/shortcode/conversation-details.php +++ b/includes/views/shortcode/conversation-details.php @@ -36,7 +36,7 @@
- +
diff --git a/src/Conversations/Conversation.php b/src/Conversations/Conversation.php index 749f2eb..3f93cdb 100644 --- a/src/Conversations/Conversation.php +++ b/src/Conversations/Conversation.php @@ -239,32 +239,37 @@ public function load_scripts(): void * if conversation id then redirect to the conversation details page * */ - public function conversation_page($atts, $content = null) - { - $this->load_scripts(); - - $url_parts = add_query_arg( NULL, NULL ); - $parts = (parse_url($url_parts, PHP_URL_QUERY)); - parse_str($parts, $query_params); - - if (is_user_logged_in()) { - ob_start(); - if (isset($query_params['td_conversation_id'])) { - thrivedesk_view('shortcode/conversation-details'); - } else { - thrivedesk_view('shortcode/conversations'); - } - + public function conversation_page($atts, $content = null) + { + $this->load_scripts(); + + $url_parts = add_query_arg(NULL, NULL); + $parts = parse_url($url_parts, PHP_URL_QUERY); + + // Initialize query_params as an empty array + $query_params = []; + + if ($parts !== null) { + parse_str($parts, $query_params); + } + + if (is_user_logged_in()) { + ob_start(); + if (isset($query_params['td_conversation_id'])) { + thrivedesk_view('shortcode/conversation-details'); + } else { + thrivedesk_view('shortcode/conversations'); + } + return ob_get_clean(); } global $wp; $redirect = home_url($wp->request); - - return '

' . __('You must be logged in to view the ticket or conversation', - 'thrivedesk') . '. Click here to login. -

'; + + return '

' . __('You must be logged in to view the ticket or conversation', 'thrivedesk') . + '. Click here to login.

'; } + /**