當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BP_Messages_Thread::delete方法代碼示例

本文整理匯總了PHP中BP_Messages_Thread::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP BP_Messages_Thread::delete方法的具體用法?PHP BP_Messages_Thread::delete怎麽用?PHP BP_Messages_Thread::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BP_Messages_Thread的用法示例。


在下文中一共展示了BP_Messages_Thread::delete方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: messages_ajax_delete

function messages_ajax_delete()
{
    global $bp;
    if (!isset($_POST['thread_ids'])) {
        echo "-1[[split]]" . __('There was a problem deleting messages.', 'buddypress');
    } else {
        $thread_ids = explode(',', $_POST['thread_ids']);
        for ($i = 0; $i < count($thread_ids); $i++) {
            BP_Messages_Thread::delete($thread_ids[$i]);
        }
        _e('Messages deleted.', 'buddypress');
    }
}
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:13,代碼來源:bp-messages-ajax.php

示例2: bp_dtheme_ajax_messages_delete

function bp_dtheme_ajax_messages_delete()
{
    global $bp;
    if (!isset($_POST['thread_ids'])) {
        echo "-1<div id='message' class='error'><p>" . __('There was a problem deleting messages.', 'buddypress') . '</p></div>';
    } else {
        $thread_ids = explode(',', $_POST['thread_ids']);
        for ($i = 0, $count = count($thread_ids); $i < $count; ++$i) {
            BP_Messages_Thread::delete($thread_ids[$i]);
        }
        _e('Messages deleted.', 'buddypress');
    }
}
開發者ID:hscale,項目名稱:webento,代碼行數:13,代碼來源:ajax.php

示例3: messages_delete_thread

function messages_delete_thread( $thread_ids ) {

	if ( is_array($thread_ids) ) {
		$error = 0;
		for ( $i = 0; $i < count($thread_ids); $i++ ) {
			if ( !$status = BP_Messages_Thread::delete($thread_ids[$i]) )
				$error = 1;
		}

		if ( $error )
			return false;

		do_action( 'messages_delete_thread', $thread_ids );

		return true;
	} else {
		if ( !BP_Messages_Thread::delete($thread_ids) )
			return false;

		do_action( 'messages_delete_thread', $thread_ids );

		return true;
	}
}
開發者ID:n-sane,項目名稱:zaroka,代碼行數:24,代碼來源:bp-messages.php

示例4: bp_dtheme_ajax_messages_delete

function bp_dtheme_ajax_messages_delete()
{
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    if (!isset($_POST['thread_ids'])) {
        echo "-1<div id='message' class='error'><p>" . __('There was a problem deleting messages.', 'buddypress') . '</p></div>';
    } else {
        $thread_ids = explode(',', $_POST['thread_ids']);
        for ($i = 0, $count = count($thread_ids); $i < $count; ++$i) {
            BP_Messages_Thread::delete($thread_ids[$i]);
        }
        _e('Messages deleted.', 'buddypress');
    }
}
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:16,代碼來源:ajax.php

示例5: messages_delete_thread

function messages_delete_thread($thread_ids)
{
    if (!check_admin_referer('messages_delete_thread')) {
        return false;
    }
    if (is_array($thread_ids)) {
        $error = 0;
        for ($i = 0; $i < count($thread_ids); $i++) {
            if (!($status = BP_Messages_Thread::delete($thread_ids[$i]))) {
                $error = 1;
            }
        }
        if ($error) {
            return false;
        }
        do_action('messages_delete_thread', $thread_ids);
        return true;
    } else {
        if (!BP_Messages_Thread::delete($thread_ids)) {
            return false;
        }
        do_action('messages_delete_thread', $thread_ids);
        return true;
    }
}
開發者ID:alvaropereyra,項目名稱:shrekcms,代碼行數:25,代碼來源:bp-messages.php

示例6: messages_delete_thread

function messages_delete_thread($thread_ids)
{
    do_action('messages_before_delete_thread', $thread_ids);
    if (is_array($thread_ids)) {
        $error = 0;
        for ($i = 0, $count = count($thread_ids); $i < $count; ++$i) {
            if (!($status = BP_Messages_Thread::delete($thread_ids[$i]))) {
                $error = 1;
            }
        }
        if (!empty($error)) {
            return false;
        }
        do_action('messages_delete_thread', $thread_ids);
        return true;
    } else {
        if (!BP_Messages_Thread::delete($thread_ids)) {
            return false;
        }
        do_action('messages_delete_thread', $thread_ids);
        return true;
    }
}
開發者ID:pyropictures,項目名稱:wordpress-plugins,代碼行數:23,代碼來源:bp-messages-functions.php

示例7: messages_delete_thread

/**
 * Deletes message thread(s) for a given user.
 *
 * Note that "deleting" a thread for a user means removing it from the user's
 * message boxes. A thread is not deleted from the database until it's been
 * "deleted" by all recipients.
 *
 * @since 2.7.0 The $user_id parameter was added. Previously the current user
 *              was always assumed.
 *
 * @param int|array $thread_ids Thread ID or array of thread IDs.
 * @param int       $user_id    ID of the user to delete the threads for. Defaults
 *                              to the current logged-in user.
 * @return bool True on success, false on failure.
 */
function messages_delete_thread($thread_ids, $user_id = 0)
{
    if (empty($user_id)) {
        $user_id = bp_loggedin_user_id();
    }
    /**
     * Fires before specified thread IDs have been deleted.
     *
     * @since 1.5.0
     * @since 2.7.0 The $user_id parameter was added.
     *
     * @param int|array $thread_ids Thread ID or array of thread IDs to be deleted.
     * @param int       $user_id    ID of the user the threads are being deleted for.
     */
    do_action('messages_before_delete_thread', $thread_ids, $user_id);
    if (is_array($thread_ids)) {
        $error = 0;
        for ($i = 0, $count = count($thread_ids); $i < $count; ++$i) {
            if (!BP_Messages_Thread::delete($thread_ids[$i], $user_id)) {
                $error = 1;
            }
        }
        if (!empty($error)) {
            return false;
        }
        /**
         * Fires after specified thread IDs have been deleted.
         *
         * @since 1.0.0
         * @since 2.7.0 The $user_id parameter was added.
         *
         * @param int|array Thread ID or array of thread IDs that were deleted.
         * @param int       ID of the user that the threads were deleted for.
         */
        do_action('messages_delete_thread', $thread_ids, $user_id);
        return true;
    } else {
        if (!BP_Messages_Thread::delete($thread_ids, $user_id)) {
            return false;
        }
        /** This action is documented in bp-messages/bp-messages-functions.php */
        do_action('messages_delete_thread', $thread_ids, $user_id);
        return true;
    }
}
開發者ID:CompositeUK,項目名稱:clone.BuddyPress,代碼行數:60,代碼來源:bp-messages-functions.php

示例8: messages_delete_thread

/**
 * Delete message thread(s).
 *
 * @param int|array Thread ID or array of thread IDs.
 *
 * @return bool True on success, false on failure.
 */
function messages_delete_thread($thread_ids)
{
    /**
     * Fires before specified thread IDs have been deleted.
     *
     * @since BuddyPress (1.5.0)
     *
     * @param int|array Thread ID or array of thread IDs that were deleted.
     */
    do_action('messages_before_delete_thread', $thread_ids);
    if (is_array($thread_ids)) {
        $error = 0;
        for ($i = 0, $count = count($thread_ids); $i < $count; ++$i) {
            if (!BP_Messages_Thread::delete($thread_ids[$i])) {
                $error = 1;
            }
        }
        if (!empty($error)) {
            return false;
        }
        /**
         * Fires after specified thread IDs have been deleted.
         *
         * @since BuddyPress (1.0.0)
         *
         * @param int|array Thread ID or array of thread IDs that were deleted.
         */
        do_action('messages_delete_thread', $thread_ids);
        return true;
    } else {
        if (!BP_Messages_Thread::delete($thread_ids)) {
            return false;
        }
        /** This action is documented in bp-messages/bp-messages-functions.php */
        do_action('messages_delete_thread', $thread_ids);
        return true;
    }
}
開發者ID:kosir,項目名稱:thatcamp-org,代碼行數:45,代碼來源:bp-messages-functions.php


注:本文中的BP_Messages_Thread::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。