本文整理匯總了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);
}