function load_conversation()
 {
     if (!wp_verify_nonce(mmg()->post('_wpnonce'), 'mm_load_conversation')) {
         exit;
     }
     $id = mmg()->decrypt(mmg()->post('id'));
     $model = MM_Conversation_Model::model()->find($id);
     $html = $this->render_inbox_message($model);
     if (!$model->is_archive()) {
         $model->mark_as_read();
         do_action('mm_conversation_read', $model);
     }
     wp_send_json(array('html' => $html, 'count_unread' => MM_Conversation_Model::count_unread(true), 'count_read' => MM_Conversation_Model::count_read(true)));
     exit;
 }
Example #2
0
                        </a>
                        <a href="<?php 
    echo add_query_arg('box', 'read', get_permalink(mmg()->setting()->inbox_page));
    ?>
"
                           class="mm-tooltip btn read-count btn-default btn-sm <?php 
    echo mmg()->get('box') == 'read' ? 'active' : null;
    ?>
"

                           data-text="<?php 
    _e("message(s)", mmg()->domain);
    ?>
"
                           title="<?php 
    echo MM_Conversation_Model::count_read();
    ?>
 <?php 
    _e("message(s)", mmg()->domain);
    ?>
">
                            <i class="glyphicon glyphicon-eye-open"></i> <?php 
    _e("Read", mmg()->domain);
    ?>
                        </a>

                        <a href="<?php 
    echo add_query_arg('box', 'sent', get_permalink(mmg()->setting()->inbox_page));
    ?>
"
                           class="btn btn-default btn-sm <?php