当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_activity_delete_by_item_id函数代码示例

本文整理汇总了PHP中bp_activity_delete_by_item_id函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_activity_delete_by_item_id函数的具体用法?PHP bp_activity_delete_by_item_id怎么用?PHP bp_activity_delete_by_item_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bp_activity_delete_by_item_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: friends_delete_activity

/**
 * Delete an activity item related to the Friends component.
 *
 * @since 1.0.0
 *
 * @param array $args {
 *     An array of arguments for the item to delete.
 *     @type int    $item_id ID of the 'item' associated with the activity item.
 *                           For Friends activity items, this is usually the user ID of one
 *                           of the friends.
 *     @type string $type    The 'type' of the activity item (eg
 *                           'friendship_accepted').
 *     @type int    $user_id ID of the user associated with the activity item.
 * }
 * @return bool True on success, false on failure.
 */
function friends_delete_activity($args)
{
    if (!bp_is_active('activity')) {
        return;
    }
    bp_activity_delete_by_item_id(array('component' => buddypress()->friends->id, 'item_id' => $args['item_id'], 'type' => $args['type'], 'user_id' => $args['user_id']));
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:23,代码来源:bp-friends-activity.php

示例2: friends_delete_activity

function friends_delete_activity($args)
{
    global $bp;
    if (bp_is_active('activity')) {
        extract((array) $args);
        bp_activity_delete_by_item_id(array('item_id' => $item_id, 'component' => $bp->friends->id, 'type' => $type, 'user_id' => $user_id));
    }
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:8,代码来源:bp-friends-activity.php

示例3: xprofile_delete_activity

/**
 * Deletes activity for a user within the profile component so that
 * it will be removed from the users activity stream and sitewide stream (if installed)
 *
 * @package BuddyPress XProfile
 * @param $args Array containing all variables used after extract() call
 * @global object $bp Global BuddyPress settings object
 * @uses bp_activity_delete() Deletes an entry to the activity component tables for a specific activity
 */
function xprofile_delete_activity($args = '')
{
    global $bp;
    if (bp_is_active('activity')) {
        extract($args);
        bp_activity_delete_by_item_id(array('item_id' => $item_id, 'component' => $bp->profile->id, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id));
    }
}
开发者ID:newington,项目名称:buddypress,代码行数:17,代码来源:bp-xprofile-activity.php

示例4: bp_blogs_delete_activity

function bp_blogs_delete_activity($args = true)
{
    global $bp;
    if (bp_is_active('activity')) {
        $defaults = array('item_id' => false, 'component' => $bp->blogs->id, 'type' => false, 'user_id' => false, 'secondary_item_id' => false);
        $params = wp_parse_args($args, $defaults);
        extract($params, EXTR_SKIP);
        bp_activity_delete_by_item_id(array('item_id' => $item_id, 'component' => $component, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id));
    }
}
开发者ID:newington,项目名称:buddypress,代码行数:10,代码来源:bp-blogs-activity.php

示例5: bp_group_management_delete_group

function bp_group_management_delete_group($group_id)
{
    global $bp;
    $group = new BP_Groups_Group($group_id);
    if (!$group->delete()) {
        return false;
    }
    /* Delete all group activity from activity streams */
    if (function_exists('bp_activity_delete_by_item_id')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->slug);
    do_action('groups_delete_group', $group_id);
    return true;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:18,代码来源:bp-group-management-aux.php

示例6: groups_update_group_forum_topic

function groups_update_group_forum_topic($topic_id, $topic_title, $topic_text, $topic_tags = false)
{
    global $bp;
    $topic_title = apply_filters('group_forum_topic_title_before_save', $topic_title);
    $topic_text = apply_filters('group_forum_topic_text_before_save', $topic_text);
    if ($topic = bp_forums_update_topic(array('topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id, 'topic_tags' => $topic_tags))) {
        // Update the activity stream item
        if (bp_is_active('activity')) {
            bp_activity_delete_by_item_id(array('item_id' => $bp->groups->current_group->id, 'secondary_item_id' => $topic_id, 'component' => $bp->groups->id, 'type' => 'new_forum_topic'));
        }
        $activity_action = sprintf(__('%1$s started the forum topic %2$s in the group %3$s', 'buddypress'), bp_core_get_userlink($topic->topic_poster), '<a href="' . bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/">' . esc_attr($topic->topic_title) . '</a>', '<a href="' . bp_get_group_permalink($bp->groups->current_group) . '">' . esc_attr($bp->groups->current_group->name) . '</a>');
        $activity_content = bp_create_excerpt($topic_text);
        // Record this in activity streams
        groups_record_activity(array('action' => apply_filters_ref_array('groups_activity_new_forum_topic_action', array($activity_action, $topic_text, &$topic)), 'content' => apply_filters_ref_array('groups_activity_new_forum_topic_content', array($activity_content, $topic_text, &$topic)), 'primary_link' => apply_filters('groups_activity_new_forum_topic_primary_link', bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/'), 'type' => 'new_forum_topic', 'item_id' => (int) $bp->groups->current_group->id, 'user_id' => (int) $topic->topic_poster, 'secondary_item_id' => $topic->topic_id, 'recorded_time ' => $topic->topic_time));
        do_action_ref_array('groups_update_group_forum_topic', array(&$topic));
        return $topic;
    }
    return false;
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:19,代码来源:bp-groups-forums.php

示例7: groups_delete_group

/**
 * Delete a group and all of its associated meta
 *
 * @global object $bp BuddyPress global settings
 * @param int $group_id
 * @since 1.0
 */
function groups_delete_group($group_id)
{
    global $bp;
    // Check the user is the group admin.
    if (!$bp->is_item_admin) {
        return false;
    }
    // Get the group object
    $group = new BP_Groups_Group($group_id);
    if (!$group->delete()) {
        return false;
    }
    do_action('groups_before_delete_group', $group_id);
    // Delete all group activity from activity streams
    if (bp_is_active('activity')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->id);
    // Remove forum if component is active and current group has one
    if (bp_is_active('forums') && ($forum_id = groups_get_groupmeta($group_id, 'forum_id'))) {
        do_action('bbpress_init');
        bb_delete_forum($forum_id);
    }
    do_action('groups_delete_group', $group_id);
    return true;
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:36,代码来源:bp-groups-functions.php

示例8: delete_activity

 /**
  * Wrapper for deleting bbPress actions from BuddyPress activity stream
  *
  * @since bbPress (r3395)
  * @param type $args Array of arguments for bp_activity_add()
  * @uses bbp_get_current_user_id()
  * @uses bp_core_current_time()
  * @uses bbp_parse_args()
  * @uses aplly_filters()
  * @uses bp_activity_add()
  * @return type Activity ID if successful, false if not
  */
 public function delete_activity($args = '')
 {
     // Default activity args
     $defaults = array('item_id' => false, 'component' => $this->component, 'type' => false, 'user_id' => false, 'secondary_item_id' => false);
     $activity = bbp_parse_args($args, $defaults, 'delete_activity');
     // Delete the activity
     bp_activity_delete_by_item_id($activity);
 }
开发者ID:hscale,项目名称:webento,代码行数:20,代码来源:activity.php

示例9: xprofile_delete_activity

/**
 * Deletes activity for a user within the profile component so that it will be
 * removed from the users activity stream and sitewide stream (if installed).
 *
 * @since 1.0.0
 *
 * @uses bp_activity_delete() Deletes an entry to the activity component tables
 *                            for a specific activity.
 *
 * @param array|string $args Containing all variables used after bp_parse_args() call.
 *
 * @return bool
 */
function xprofile_delete_activity($args = '')
{
    // Bail if activity component is not active.
    if (!bp_is_active('activity')) {
        return false;
    }
    // Parse the arguments.
    $r = bp_parse_args($args, array('component' => buddypress()->profile->id), 'xprofile_delete_activity');
    // Delete the activity item.
    bp_activity_delete_by_item_id($r);
}
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:24,代码来源:bp-xprofile-activity.php

示例10: groups_delete_group

/**
 * Delete a group and all of its associated meta
 *
 * @global object $bp BuddyPress global settings
 * @param int $group_id
 * @since BuddyPress (1.0)
 */
function groups_delete_group($group_id)
{
    global $bp;
    // Check the user is the group admin.
    if (!bp_is_item_admin()) {
        return false;
    }
    do_action('groups_before_delete_group', $group_id);
    // Get the group object
    $group = groups_get_group(array('group_id' => $group_id));
    if (!$group->delete()) {
        return false;
    }
    // Delete all group activity from activity streams
    if (bp_is_active('activity')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->id);
    do_action('groups_delete_group', $group_id);
    return true;
}
开发者ID:novichkovv,项目名称:candoweightloss,代码行数:31,代码来源:bp-groups-functions.php

示例11: friends_delete_activity

function friends_delete_activity( $args ) {
	if ( function_exists('bp_activity_delete_by_item_id') ) {
		extract( (array)$args );
		bp_activity_delete_by_item_id( array( 'item_id' => $item_id, 'component' => $bp->friends->id, 'type' => $type, 'user_id' => $user_id, 'secondary_item_id' => $secondary_item_id ) );
	}
}
开发者ID:n-sane,项目名称:zaroka,代码行数:6,代码来源:bp-friends.php

示例12: rendez_vous_delete_item_activities

/**
 * Deletes activities of a cancelled rendez-vous
 *
 * @package Rendez Vous
 * @subpackage Activity
 *
 * @since Rendez Vous (1.0.0)
 */
function rendez_vous_delete_item_activities($rendez_vous_id = 0, $rendez_vous = null)
{
    if (empty($rendez_vous_id)) {
        return;
    }
    $rendez_vous_status = 'publish';
    if (is_a($rendez_vous, 'WP_Post')) {
        $rendez_vous_status = $rendez_vous->post_status;
    } else {
        if (is_a($rendez_vous, 'Rendez_Vous_Item')) {
            $rendez_vous_status = $rendez_vous->status;
        }
    }
    // No need to delete activities in case of drafts
    if (!empty($rendez_vous) && 'draft' == $rendez_vous_status) {
        return;
    }
    $types = array('new_rendez_vous', 'updated_rendez_vous');
    $args = apply_filters('rendez_vous_delete_item_activities_args', array('item_id' => $rendez_vous_id, 'component' => buddypress()->rendez_vous->id));
    foreach ($types as $type) {
        $args['type'] = $type;
        bp_activity_delete_by_item_id($args);
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:32,代码来源:rendez-vous-activity.php

示例13: bp_blogs_delete_activity

/**
 * Delete a blog-related activity stream item.
 *
 * @since 1.0.0
 *
 * @see bp_activity_delete() for description of parameters.
 *
 * @param array|string $args {
 *     See {@link bp_activity_delete()} for complete description of arguments.
 *     The arguments listed here have different default values from
 *     bp_activity_add().
 *     @type string $component Default: 'blogs'.
 * }
 * @return bool True on success, false on failure.
 */
function bp_blogs_delete_activity($args = '')
{
    $r = bp_parse_args($args, array('item_id' => false, 'component' => buddypress()->blogs->id, 'type' => false, 'user_id' => false, 'secondary_item_id' => false));
    bp_activity_delete_by_item_id($r);
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:20,代码来源:bp-blogs-activity.php

示例14: bp_activity_post_type_remove_comment

/**
 * Remove an activity item when a comment about a post type is deleted.
 *
 * @since 2.5.0
 *
 * @param  int    $comment_id           ID of the comment.
 * @param  object $activity_post_object The post type tracking args object.
 *
 * @return bool True on success. False on error.
 */
function bp_activity_post_type_remove_comment($comment_id = 0, $activity_post_object = null)
{
    if (empty($activity_post_object)) {
        $comment = get_comment($comment_id);
        if (!$comment) {
            return;
        }
        $post_type = get_post_type($comment->comment_post_ID);
        if (!$post_type) {
            return;
        }
        // Get the post type tracking args.
        $activity_post_object = bp_activity_get_post_type_tracking_args($post_type);
        // Bail if the activity type does not exist
        if (empty($activity_post_object->comments_tracking->action_id)) {
            return false;
        }
    }
    // Set the $activity_comment_object
    $activity_comment_object = $activity_post_object->comments_tracking;
    if (empty($activity_comment_object->action_id)) {
        return false;
    }
    $deleted = false;
    if (bp_disable_blogforum_comments()) {
        $deleted = bp_activity_delete_by_item_id(array('item_id' => get_current_blog_id(), 'secondary_item_id' => $comment_id, 'component' => $activity_comment_object->component_id, 'type' => $activity_comment_object->action_id, 'user_id' => false));
    }
    /**
     * Fires after the custom post type comment activity was removed.
     *
     * @since 2.5.0
     *
     * @param bool       $deleted              True if the activity was deleted false otherwise
     * @param WP_Comment $comment              Comment object.
     * @param object     $activity_post_object The post type tracking args object.
     * @param string     $value                The post type comment activity type.
     */
    do_action('bp_activity_post_type_remove_comment', $deleted, $comment_id, $activity_post_object, $activity_comment_object->action_id);
    return $deleted;
}
开发者ID:humanmade,项目名称:BuddyPress,代码行数:50,代码来源:bp-activity-functions.php

示例15: thatcamp_delete_group_for_blog

/**
 * When a blog is spammed, archived, or deleted, delete the corresponding group
 *
 * @param int
 */
function thatcamp_delete_group_for_blog($blog_id)
{
    global $bp;
    $group_id = thatcamp_get_blog_group($blog_id);
    // do it manually, to avoid groups_delete_group() cap check
    do_action('groups_before_delete_group', $group_id);
    // Get the group object
    $group = groups_get_group(array('group_id' => $group_id));
    if (!$group->delete()) {
        return false;
    }
    // Delete all group activity from activity streams
    if (bp_is_active('activity')) {
        bp_activity_delete_by_item_id(array('item_id' => $group_id, 'component' => $bp->groups->id));
    }
    // Remove all outstanding invites for this group
    groups_delete_all_group_invites($group_id);
    // Remove all notifications for any user belonging to this group
    bp_core_delete_all_notifications_by_type($group_id, $bp->groups->id);
    do_action('groups_delete_group', $group_id);
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:26,代码来源:thatcamp-group-blogs.php


注:本文中的bp_activity_delete_by_item_id函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。