本文整理汇总了PHP中BP_Messages_Thread::check_access方法的典型用法代码示例。如果您正苦于以下问题:PHP BP_Messages_Thread::check_access方法的具体用法?PHP BP_Messages_Thread::check_access怎么用?PHP BP_Messages_Thread::check_access使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BP_Messages_Thread
的用法示例。
在下文中一共展示了BP_Messages_Thread::check_access方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: messages_check_thread_access
function messages_check_thread_access( $thread_id, $user_id = false ) {
global $bp;
if ( !$user_id )
$user_id = $bp->loggedin_user->id;
return BP_Messages_Thread::check_access( $thread_id, $user_id );
}
示例2: test_check_access_invalid_thread
/**
* @group check_access
*/
public function test_check_access_invalid_thread()
{
$this->assertEquals(null, BP_Messages_Thread::check_access(999, 1));
}
示例3: messages_check_thread_access
function messages_check_thread_access($thread_id, $user_id = 0)
{
if (empty($user_id)) {
$user_id = bp_loggedin_user_id();
}
return BP_Messages_Thread::check_access($thread_id, $user_id);
}
示例4: messages_action_bulk_delete
function messages_action_bulk_delete()
{
global $bp, $thread_ids;
if ($bp->current_component != $bp->messages->slug || $bp->action_variables[0] != 'bulk-delete') {
return false;
}
$thread_ids = $_POST['thread_ids'];
if (!$thread_ids || !BP_Messages_Thread::check_access($thread_ids)) {
bp_core_redirect($bp->displayed_user->domain . $bp->current_component . '/' . $bp->current_action);
} else {
if (!messages_delete_thread($thread_ids)) {
bp_core_add_message(__('There was an error deleting messages.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('Messages deleted.', 'buddypress'));
}
bp_core_redirect($bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action);
}
}
示例5: messages_check_thread_access
function messages_check_thread_access($thread_id, $user_id = 0)
{
global $bp;
if (empty($user_id)) {
$user_id = $bp->loggedin_user->id;
}
return BP_Messages_Thread::check_access($thread_id, $user_id);
}