[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-blogs/ -> bp-blogs-activity.php (summary)

BuddyPress Blogs Activity.

File Size: 1502 lines (50 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 26 functions

  bp_blogs_register_activity_actions()
  bp_blogs_register_post_tracking_args()
  bp_blogs_format_activity_action_new_blog()
  bp_blogs_format_activity_action_new_blog_post()
  bp_blogs_format_activity_action_new_blog_comment()
  bp_blogs_prefetch_activity_object_data()
  bp_blogs_record_activity()
  bp_blogs_delete_activity()
  bp_blogs_comments_open()
  bp_blogs_record_activity_on_site_creation()
  bp_blogs_delete_new_blog_activity_for_site()
  bp_blogs_delete_activity_for_site()
  bp_blogs_remove_post()
  bp_blogs_sync_add_from_activity_comment()
  bp_blogs_sync_delete_from_activity_comment()
  bp_blogs_sync_activity_edit_to_post_comment()
  bp_blogs_remove_activity_meta_for_trashed_comments()
  bp_blogs_new_blog_comment_query_backpat()
  bp_blogs_setup_activity_loop_globals()
  bp_blogs_setup_comment_loop_globals_on_ajax()
  bp_blogs_disable_activity_commenting()
  bp_blogs_post_type_comments_avoid_duplicates()
  bp_blogs_can_comment_reply()
  bp_blogs_activity_comment_permalink()
  bp_blogs_activity_comment_single_permalink()
  bp_blogs_activity_comment_single_action()

Functions
Functions that are not part of a class:

bp_blogs_register_activity_actions()   X-Ref
Register activity actions for the blogs component.

return: bool|null Returns false if activity component is not active.
since: 1.0.0

bp_blogs_register_post_tracking_args( $params = null, $post_type = 0 )   X-Ref
Set up the tracking arguments for the 'post' post type.

param: object|null $params    Tracking arguments.
param: string|int  $post_type Post type to track.
return: object|null
since: 2.5.0 This was moved out of the BP_Blogs_Component class.

bp_blogs_format_activity_action_new_blog( $action, $activity )   X-Ref
Format 'new_blog' activity actions.

param: string $action   Static activity action.
param: object $activity Activity data object.
return: string
since: 2.0.0

bp_blogs_format_activity_action_new_blog_post( $action, $activity )   X-Ref
Format 'new_blog_post' activity actions.

param: string $action   Static activity action.
param: object $activity Activity data object.
return: string Constructed activity action.
since: 2.0.0

bp_blogs_format_activity_action_new_blog_comment( $action, $activity )   X-Ref
Format 'new_blog_comment' activity actions.

param: string $action   Static activity action.
param: object $activity Activity data object.
return: string Constructed activity action.
since: 2.0.0

bp_blogs_prefetch_activity_object_data( $activities )   X-Ref
Fetch data related to blogs at the beginning of an activity loop.

This reduces database overhead during the activity loop.

param: array $activities Array of activity items.
return: array
since: 2.0.0

bp_blogs_record_activity( $args = '' )   X-Ref
Record blog-related activity to the activity stream.

param: array|string $args {
return: WP_Error|bool|int On success, returns the activity ID. False on failure.
since: 1.0.0

bp_blogs_delete_activity( $args = '' )   X-Ref
Delete a blog-related activity stream item.

param: array|string $args {
return: bool True on success, false on failure.
since: 1.0.0

bp_blogs_comments_open( $activity )   X-Ref
Check if a blog post's activity item should be closed from commenting.

This mirrors the {@link comments_open()} and {@link _close_comments_for_old_post()}
functions, but for use with the BuddyPress activity stream to be as
lightweight as possible.

By lightweight, we actually mirror a few of the blog's commenting settings
to blogmeta and checks the values in blogmeta instead.  This is to prevent
multiple {@link switch_to_blog()} calls in the activity stream.

param: object $activity The BP_Activity_Activity object.
return: bool
since: 2.0.0

bp_blogs_record_activity_on_site_creation( $recorded_blog, $is_private, $is_recorded, $no_activity )   X-Ref
Add an activity entry for a newly-created site.

Hooked to the 'bp_blogs_new_blog' action.

param: BP_Blogs_Blog $recorded_blog Current site being recorded. Passed by reference.
param: bool          $is_private    Whether the current site being recorded is private.
param: bool          $is_recorded   Whether the current site was recorded.
since: 2.6.0

bp_blogs_delete_new_blog_activity_for_site( $blog_id, $user_id = 0 )   X-Ref
Deletes the 'new_blog' activity entry when a site is deleted.

param: int $blog_id Site ID.
since: 2.6.0

bp_blogs_delete_activity_for_site( $blog_id )   X-Ref
Delete all 'blogs' activity items for a site when the site is deleted.

param: int $blog_id Site ID.
since: 2.6.0

bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 )   X-Ref
Remove a blog post activity item from the activity stream.

param: int $post_id ID of the post to be removed.
param: int $blog_id Optional. Defaults to current blog ID.
param: int $user_id Optional. Defaults to the logged-in user ID. This param
return: bool
since: 1.0.0

bp_blogs_sync_add_from_activity_comment( $comment_id, $params, $parent_activity )   X-Ref
Syncs activity comments and posts them back as blog comments.

Note: This is only a one-way sync - activity comments -> blog comment.

For blog post -> activity comment, see {@link bp_activity_post_type_comment()}.

param: int    $comment_id      The activity ID for the posted activity comment.
param: array  $params          Parameters for the activity comment.
param: object $parent_activity Parameters of the parent activity item (in this case, the blog post).
since: 2.0.0
since: 2.5.0 Allow custom post types to sync their comments with activity ones

bp_blogs_sync_delete_from_activity_comment( $retval, $parent_activity_id, $activity_id, &$deleted )   X-Ref
Deletes the blog comment when the associated activity comment is deleted.

Note: This is hooked on the 'bp_activity_delete_comment_pre' filter instead
of the 'bp_activity_delete_comment' action because we need to fetch the
activity comment children before they are deleted.

param: bool $retval             Whether BuddyPress should continue or not.
param: int  $parent_activity_id The parent activity ID for the activity comment.
param: int  $activity_id        The activity ID for the pending deleted activity comment.
param: bool $deleted            Whether the comment was deleted or not.
return: bool
since: 2.0.0
since: 2.5.0 Add the $delected parameter

bp_blogs_sync_activity_edit_to_post_comment( BP_Activity_Activity $activity )   X-Ref
Updates the blog comment when the associated activity comment is edited.

param: BP_Activity_Activity $activity The activity object.
since: 2.0.0

bp_blogs_remove_activity_meta_for_trashed_comments( $post_id = 0, $comments = array()   X-Ref
When a post is trashed, remove each comment's associated activity meta.

When a post is trashed and later untrashed, we currently don't reinstate
activity items for these comments since their activity entries are already
deleted when initially trashed.

Since these activity entries are deleted, we need to remove the deleted
activity comment IDs from each comment's meta when a post is trashed.

param: int   $post_id  The post ID.
param: array $comments Array of comment statuses. The key is comment ID, the
since: 2.0.0

bp_blogs_new_blog_comment_query_backpat( $args )   X-Ref
Filter 'new_blog_comment' bp_has_activities() loop to include new- and old-style blog activity comment items.

In BuddyPress 2.0, the schema for storing activity items related to blog
posts changed. Instead creating new top-level 'new_blog_comment' activity
items, blog comments are recorded in the activity stream as comments on the
'new_blog_post' activity items corresponding to the parent post. This filter
ensures that the 'new_blog_comment' filter in bp_has_activities() (which
powers the 'Comments' filter in the activity directory dropdown) includes
both old-style and new-style activity comments.

param: array $args Arguments passed from bp_parse_args() in bp_has_activities().
return: array $args
since: 2.1.0
since: 2.5.0 Used for any synced Post type comments, in wp-admin or front-end contexts.

bp_blogs_setup_activity_loop_globals( $activity )   X-Ref
Utility function to set up some variables for use in the activity loop.

Grabs the blog's comment depth and the post's open comment status options
for later use in the activity and activity comment loops.

This is to prevent having to requery these items later on.

param: object $activity The BP_Activity_Activity object.
since: 2.0.0

bp_blogs_setup_comment_loop_globals_on_ajax()   X-Ref
Set up some globals used in the activity comment loop when AJAX is used.

since: 2.0.0

bp_blogs_disable_activity_commenting( $retval )   X-Ref
Disable activity commenting for blog posts based on certain criteria.

If activity commenting is enabled for blog posts, we still need to disable
commenting if:
- comments are disabled for the WP blog post from the admin dashboard
- the WP blog post is supposed to be automatically closed from comments
based on a certain age
- the activity entry is a 'new_blog_comment' type

param: bool $retval Is activity commenting enabled for this activity entry.
return: bool
since: 2.0.0

bp_blogs_post_type_comments_avoid_duplicates( $retval )   X-Ref
Limit the display of post type synced comments.

param: int $retval  The comment count for the activity.
return: int          The comment count, or 0 to hide activity comment replies.
since: 2.5.0

bp_blogs_can_comment_reply( $retval, $comment )   X-Ref
Check if an activity comment associated with a blog post can be replied to.

By default, disables replying to activity comments if the corresponding WP
blog post no longer accepts comments.

This check uses a locally-cached value set in {@link bp_blogs_disable_activity_commenting()}
via {@link bp_blogs_setup_activity_loop_globals()}.

param: bool         $retval  Are replies allowed for this activity reply.
param: object|array $comment The activity comment object.
return: bool
since: 2.0.0

bp_blogs_activity_comment_permalink( $retval = '' )   X-Ref
Changes activity comment permalinks to use the blog comment permalink
instead of the activity permalink.

This is only done if activity commenting is allowed and whether the parent
activity item is a 'new_blog_post' entry.

param: string $retval The activity comment permalink.
return: string
since: 2.0.0

bp_blogs_activity_comment_single_permalink( $retval, $activity )   X-Ref
Changes single activity comment entries to use the blog comment permalink.

This is only done if the activity comment is associated with a blog comment.

param: string               $retval   The activity permalink.
param: BP_Activity_Activity $activity Activity object.
return: string
since: 2.0.1

bp_blogs_activity_comment_single_action( $retval, $activity )   X-Ref
Formats single activity comment entries to use the blog comment action.

This is only done if the activity comment is associated with a blog comment.

param: string               $retval   The activity action.
param: BP_Activity_Activity $activity Activity object.
return: string
since: 2.0.1



Generated: Thu Apr 25 01:01:12 2024 Cross-referenced by PHPXref 0.7.1