| @@ -47,17 +47,17 @@ | ||
| 47 | 47 | <?php if(wmvc_show_data('link_dash_icon_position', $settings) == 'right') :?> |
| 48 | 48 | <?php \Elementor\Icons_Manager::render_icon( $settings['link_dash_icon'], [ 'aria-hidden' => 'true' ] ); ?> |
| 49 | 49 | <?php endif;?> |
| 50 | 50 | </a> |
| 51 | - <?php if(function_exists('run_wdk_messages_chat')):?> | |
| 51 | + <?php if(function_exists('run_wdk_messages_chat') && function_exists('wdk_dash_url')):?> | |
| 52 | 52 | <?php |
| 53 | 53 | global $Winter_MVC_wdk_messages_chat; |
| 54 | - $Winter_MVC_wdk_messages_chat->model('messageschat_m'); | |
| 55 | - $total_new_message = $Winter_MVC_wdk_messages_chat->messageschat_m->total_relationship_user(get_current_user_id(), array('chat_is_readed IS NULL'=>NULL)); | |
| 54 | + $this->WMVC->model('messages_m'); | |
| 55 | + $total_new_message = $this->WMVC->messages_m->total_unread(); | |
| 56 | 56 | if($total_new_message): |
| 57 | 57 | ?> |
| 58 | 58 | <a href="<?php echo esc_url(wdk_dash_url('dash_page=messages&function=chat'));?>" |
| 59 | - title="<?php echo esc_html__('New messages', 'wpdirectorykit');?>" class="count_messages"> | |
| 59 | + title="<?php echo esc_attr__('New messages', 'wpdirectorykit');?>" class="count_messages"> | |
| 60 | 60 | <?php echo esc_html($total_new_message);?> |
| 61 | 61 | </a> |
| 62 | 62 | <?php endif;?> |
| 63 | 63 | <?php endif;?> |