Exemplo n.º 1
0
<div id="ap-messages">
	<div class="ap-messages-left">
		<div class="ap-messages-left-c">
			<div class="ap-message-search">
				<form method="GET" data-role="ap-search-conversations">
					<input type="text" class="form-control" name="s" placeholder="<?php 
_e('Search messages', 'ap');
?>
" data-action="ap-search-conversations" />
					<input type="hidden" name="action" value="ap_message_search" />
					<input type="hidden" name="_nonce" value="<?php 
echo wp_create_nonce('search_message');
?>
" />
				</form>
			</div>
			<div id="ap-conversation-scroll" data-offset="1" data-args="<?php 
echo wp_create_nonce('conversations_list');
?>
">
				<?php 
ap_conversations_list();
?>
			</div>
		</div>
	</div>
	<!--<div class="ap-messages-right" data-view="conversation">
	</div>-->
</div>
Exemplo n.º 2
0
 public function ap_message_search()
 {
     if (wp_verify_nonce($_GET['_nonce'], 'search_message')) {
         ob_start();
         ap_conversations_list(get_current_user_id(), 0, 50, true);
         $html = ob_get_clean();
         $result = array('status' => true, 'html' => $html);
     } else {
         $result = array('status' => false, 'message' => __('Something went wrong! cannot search for conversations.', 'ap'));
     }
     die(json_encode($result));
 }