BP_Messages_Box_Template: the_message_thread ()

在循环中设置当前线程。

描述

所使用的bp_message_thread ()在循环时设置当前线程数据,以便在迭代期间使用的模板标记引用当前线程。

另请参阅

文件:bp-messages /类/ class-bp-messages-box-template.php

Public function the_message_thread() {$this->in_the_loop = true;$ this - >线程= $ this - > next_thread ();如果(!Bp_is_current_action ('notice ')) {$last_message_index = 0;// $this->thread->messages = array_reverse((array) $this->thread->messages);$this->thread->last_message_id = $this->thread->messages[$last_message_index]->id;$this->thread->last_message_date = $this->thread->messages[$last_message_index]->date_sent;$this->thread->last_sender_id = $this->thread->messages[$last_message_index]->sender_id;$this->thread->last_message_subject = $this->thread->messages[$last_message_index]->subject;$this->thread->last_message_content = $this->thread->messages[$last_message_index]->message; } // Loop has just started. if ( 0 == $this->current_thread ) { /** * Fires if at the start of the message thread loop. * * @since BuddyPress 1.5.0 */ do_action( 'messages_box_loop_start' ); } }

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队