[ Index ] |
PHP Cross Reference of BuddyPress |
[Source view] [Print] [Project Stats]
BuddyPress Activity Functions. Functions for the Activity Streams component.
File Size: | 4445 lines (153 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
bp_activity_has_directory() X-Ref |
Check whether the $bp global lists an activity directory page. since: 1.5.0 return: bool True if activity directory page is found, otherwise false. |
bp_activity_do_mentions() X-Ref |
Are mentions enabled or disabled? The Mentions feature does a number of things, all of which will be turned off if you disable mentions: - Detecting and auto-linking @username in all BP/WP content. - Sending BP notifications and emails to users when they are mentioned using the @username syntax. - The Public Message button on user profiles. Mentions are enabled by default. To disable, put the following line in bp-custom.php or your theme's functions.php file: add_filter( 'bp_activity_do_mentions', '__return_false' ); since: 1.8.0 return: bool $retval True to enable mentions, false to disable. |
bp_activity_maybe_load_mentions_scripts() X-Ref |
Should BuddyPress load the mentions scripts and related assets, including results to prime the mentions suggestions? since: 2.1.0 return: bool True if mentions scripts should be loaded. |
bp_activity_find_mentions( $content ) X-Ref |
Locate usernames in an activity content string, as designated by an @ sign. param: string $content The content of the activity, usually found in since: 1.5.0 return: array|bool Associative array with user ID as key and username as |
bp_activity_clear_new_mentions( $user_id ) X-Ref |
Reset a user's unread mentions list and count. param: int $user_id The id of the user whose unread mentions are being reset. since: 1.5.0 |
bp_activity_adjust_mention_count( $activity_id = 0, $action = 'add' ) X-Ref |
Adjusts mention count for mentioned users in activity items. This function is useful if you only have the activity ID handy and you haven't parsed an activity item for @mentions yet. Currently, only used in {@link bp_activity_delete()}. param: int $activity_id The unique id for the activity item. param: string $action Can be 'delete' or 'add'. Defaults to 'add'. since: 1.5.0 return: bool |
bp_activity_update_mention_count_for_user( $user_id, $activity_id, $action = 'add' ) X-Ref |
Update the mention count for a given user. This function should be used when you've already parsed your activity item for @mentions. param: int $user_id The user ID. param: int $activity_id The unique ID for the activity item. param: string $action 'delete' or 'add'. Default: 'add'. since: 1.7.0 return: bool |
bp_activity_get_user_mentionname( $user_id ) X-Ref |
Determine a user's "mentionname", the name used for that user in @-mentions. param: int|string $user_id ID of the user to get @-mention name for. since: 1.9.0 return: string $mentionname User name appropriate for @-mentions. |
bp_activity_get_userid_from_mentionname( $mentionname ) X-Ref |
Get a user ID from a "mentionname", the name used for a user in @-mentions. param: string $mentionname Username of user in @-mentions. since: 1.9.0 return: int|bool ID of the user, if one is found. Otherwise false. |
bp_activity_set_action( $component_id, $type, $description, $format_callback = false, $label = false, $context = array() X-Ref |
Register an activity 'type' and its action description/callback. Activity actions are strings used to describe items in the activity stream, such as 'Joe became a registered member' or 'Bill and Susie are now friends'. Each activity type (such as 'new_member' or 'friendship_created') used by a component should be registered using this function. While it's possible to post items to the activity stream whose types are not registered using bp_activity_set_action(), it is not recommended; unregistered types will not be displayed properly in the activity admin panel, and dynamic action generation (which is essential for multilingual sites, etc) will not work. param: string $component_id The unique string ID of the component. param: string $type The action type. param: string $description The action description. param: callable|bool $format_callback Callback for formatting the action string. param: string|bool $label String to describe this action in the activity stream filter dropdown. param: array $context Optional. Activity stream contexts where the filter should appear. param: int $position Optional. The position of the action when listed in dropdowns. since: 1.1.0 return: bool False if any param is empty, otherwise true. |
bp_activity_set_post_type_tracking_args( $post_type = '', $args = array() X-Ref |
Set tracking arguments for a given post type. param: string $post_type The name of the post type, as registered with WordPress. Eg 'post' or 'page'. param: array $args { since: 2.2.0 return: bool |
bp_activity_get_post_type_tracking_args( $post_type ) X-Ref |
Get tracking arguments for a specific post type. param: string $post_type Name of the post type. since: 2.2.0 since: 2.5.0 Add post type comments tracking args return: object The tracking arguments of the post type. |
bp_activity_get_post_types_tracking_args() X-Ref |
Get tracking arguments for all post types. since: 2.2.0 since: 2.5.0 Include post type comments tracking args if needed return: array List of post types with their tracking arguments. |
_bp_activity_get_types_by_support( $feature = 'generated-content' ) X-Ref |
Gets the list of activity types name supporting the requested feature. This function is still a WIP, please don't use it into your plugins or themes. param: string $feature The feature activity types should support. since: 10.0.0 return: array The list of activity types name supporting the requested feature. |
bp_activity_type_supports( $activity_type = '', $feature = '' ) X-Ref |
Check if the *Post Type* activity supports a specific feature. param: string $activity_type The activity type to check. param: string $feature The feature to check. Currently supports: since: 2.5.0 return: bool |
bp_activity_post_type_get_tracking_arg( $activity_type, $arg = '' ) X-Ref |
Get a specific tracking argument for a given activity type param: string $activity_type the activity type. param: string $arg the key of the tracking argument. since: 2.5.0 return: mixed the value of the tracking arg, false if not found. |
bp_activity_get_actions() X-Ref |
Get all components' activity actions, sorted by their position attribute. since: 2.2.0 return: object Actions ordered by their position. |
bp_activity_get_action( $component_id, $key ) X-Ref |
Retrieve the current action from a component and key. param: string $component_id The unique string ID of the component. param: string $key The action key. since: 1.1.0 return: string|bool Action value if found, otherwise false. |
bp_activity_get_types() X-Ref |
Fetch details of all registered activity types. since: 1.7.0 return: array array( type => description ), ... |
bp_activity_get_types_list() X-Ref |
Returns the list of available BuddyPress activity types. since: 9.0.0 return: array An array of activity type labels keyed by type names. |
bp_activity_get_current_context() X-Ref |
Gets the current activity context. The "context" is the current view type, corresponding roughly to the current component. Use this context to determine which activity actions should be permitted in the filter dropdown. since: 2.8.0 return: string Activity context. 'member', 'member_groups', 'group', 'activity'. |
bp_activity_get_actions_for_context( $context = '' ) X-Ref |
Gets a flat list of activity actions compatible with a given context. param: string $context Optional. Name of the context. Defaults to the current context. since: 2.8.0 return: array |
bp_activity_get_user_favorites( $user_id = 0 ) X-Ref |
Get a users favorite activity stream items. param: int $user_id ID of the user whose favorites are being queried. since: 1.2.0 return: array IDs of the user's favorite activity items. |
bp_activity_add_user_favorite( $activity_id, $user_id = 0 ) X-Ref |
Add an activity stream item as a favorite for a user. param: int $activity_id ID of the activity item being favorited. param: int $user_id ID of the user favoriting the activity item. since: 1.2.0 return: bool True on success, false on failure. |
bp_activity_remove_user_favorite( $activity_id, $user_id = 0 ) X-Ref |
Remove an activity stream item as a favorite for a user. param: int $activity_id ID of the activity item being unfavorited. param: int $user_id ID of the user unfavoriting the activity item. since: 1.2.0 return: bool True on success, false on failure. |
bp_activity_check_exists_by_content( $content ) X-Ref |
Check whether an activity item exists with a given content string. param: string $content The content to filter by. since: 1.1.0 return: int|null The ID of the located activity item. Null if none is found. |
bp_activity_get_last_updated() X-Ref |
Retrieve the last time activity was updated. since: 1.0.0 return: string Date last updated. |
bp_activity_total_favorites_for_user( $user_id = 0 ) X-Ref |
Retrieve the number of favorite activity stream items a user has. param: int $user_id ID of the user whose favorite count is being requested. since: 1.2.0 return: int Total favorite count for the user. |
bp_activity_delete_meta( $activity_id, $meta_key = '', $meta_value = '', $delete_all = false ) X-Ref |
Delete a meta entry from the DB for an activity stream item. param: int $activity_id ID of the activity item whose metadata is being deleted. param: string $meta_key Optional. The key of the metadata being deleted. If param: string $meta_value Optional. If present, the metadata will only be param: bool $delete_all Optional. If true, delete matching metadata entries since: 1.2.0 return: bool True on success, false on failure. |
bp_activity_get_meta( $activity_id = 0, $meta_key = '', $single = true ) X-Ref |
Get metadata for a given activity item. param: int $activity_id ID of the activity item whose metadata is being requested. param: string $meta_key Optional. If present, only the metadata matching param: bool $single Optional. If true, return only the first value of the since: 1.2.0 return: mixed The meta value(s) being requested. |
bp_activity_update_meta( $activity_id, $meta_key, $meta_value, $prev_value = '' ) X-Ref |
Update a piece of activity meta. param: int $activity_id ID of the activity item whose metadata is being updated. param: string $meta_key Key of the metadata being updated. param: mixed $meta_value Value to be set. param: mixed $prev_value Optional. If specified, only update existing metadata entries since: 1.2.0 return: bool|int Returns false on failure. On successful update of existing |
bp_activity_add_meta( $activity_id, $meta_key, $meta_value, $unique = false ) X-Ref |
Add a piece of activity metadata. param: int $activity_id ID of the activity item. param: string $meta_key Metadata key. param: mixed $meta_value Metadata value. param: bool $unique Optional. Whether to enforce a single metadata value for the since: 2.0.0 return: int|bool The meta ID on successful update, false on failure. |
bp_activity_remove_all_user_data( $user_id = 0 ) X-Ref |
Completely remove a user's activity data. param: int $user_id ID of the user whose activity is being deleted. since: 1.5.0 return: bool |
bp_activity_remove_all_user_data_on_delete_user( $user_id ) X-Ref |
Deletes user activity data on the 'delete_user' hook. param: int $user_id The ID of the deleted user. since: 6.0.0 |
bp_activity_spam_all_user_data( $user_id = 0 ) X-Ref |
Mark all of the user's activity as spam. param: int $user_id ID of the user whose activity is being spammed. since: 1.6.0 return: bool |
bp_activity_ham_all_user_data( $user_id = 0 ) X-Ref |
Mark all of the user's activity as ham (not spam). param: int $user_id ID of the user whose activity is being hammed. since: 1.6.0 return: bool |
bp_register_activity_actions() X-Ref |
Allow core components and dependent plugins to register activity actions. since: 1.2.0 |
bp_activity_register_activity_actions() X-Ref |
Register the activity stream actions for updates. since: 1.6.0 |
bp_activity_generate_action_string( $activity ) X-Ref |
Generate an activity action string for an activity item. param: object $activity Activity data object. since: 2.0.0 return: string|bool Returns false if no callback is found, otherwise returns |
bp_activity_format_activity_action_activity_update( $action, $activity ) X-Ref |
Format 'activity_update' activity actions. param: string $action Static activity action. param: object $activity Activity data object. since: 2.0.0 return: string $action |
bp_activity_format_activity_action_activity_comment( $action, $activity ) X-Ref |
Format 'activity_comment' activity actions. param: string $action Static activity action. param: object $activity Activity data object. since: 2.0.0 return: string $action |
bp_activity_format_activity_action_custom_post_type_post( $action, $activity ) X-Ref |
Format activity action strings for custom post types. param: string $action Static activity action. param: object $activity Activity data object. since: 2.2.0 return: string $action |
bp_activity_format_activity_action_custom_post_type_comment( $action, $activity ) X-Ref |
Format activity action strings for custom post types comments. param: string $action Static activity action. param: object $activity Activity data object. since: 2.5.0 return: string |
bp_activity_get( $args = '' ) X-Ref |
Retrieve an activity or activities. The bp_activity_get() function shares all arguments with BP_Activity_Activity::get(). The following is a list of bp_activity_get() parameters that have different default values from BP_Activity_Activity::get() (value in parentheses is the default for the bp_activity_get()). - 'per_page' (false) param: array|string $args See BP_Activity_Activity::get() for description. since: 1.2.0 since: 2.4.0 Introduced the `$fields` parameter. return: array $activity See BP_Activity_Activity::get() for description. |
bp_activity_get_specific( $args = '' ) X-Ref |
Fetch specific activity items. param: array|string $args { since: 1.2.0 return: array See BP_Activity_Activity::get() for description. |
bp_activity_add( $args = '' ) X-Ref |
Add an activity item. param: array|string $args { since: 1.1.0 since: 2.6.0 Added 'error_type' parameter to $args. return: WP_Error|bool|int The ID of the activity on success. False on error. |
bp_activity_post_update( $args = '' ) X-Ref |
Post an activity update. param: array|string $args { since: 1.2.0 return: int|bool|WP_Error $activity_id The activity id on success. On failure, either boolean false or WP_Error |
bp_activity_post_type_publish( $post_id = 0, $post = null, $user_id = 0 ) X-Ref |
Create an activity item for a newly published post type post. param: int $post_id ID of the new post. param: WP_Post|null $post Post object. param: int $user_id ID of the post author. since: 2.2.0 return: null|WP_Error|bool|int The ID of the activity on success. False on error. |
bp_activity_post_type_update( $post = null ) X-Ref |
Update the activity item for a custom post type entry. param: WP_Post|null $post Post item. since: 2.2.0 return: null|WP_Error|bool True on success, false on failure. |
bp_activity_post_type_unpublish( $post_id = 0, $post = null ) X-Ref |
Unpublish an activity for the custom post type. param: int $post_id ID of the post being unpublished. param: WP_Post|null $post Post object. since: 2.2.0 return: bool True on success, false on failure. |
bp_activity_post_type_comment( $comment_id = 0, $is_approved = true, $activity_post_object = null ) X-Ref |
Create an activity item for a newly posted post type comment. param: int $comment_id ID of the comment. param: bool $is_approved Whether the comment is approved or not. param: object|null $activity_post_object The post type tracking args object. since: 2.5.0 return: null|WP_Error|bool|int The ID of the activity on success. False on error. |
bp_activity_post_type_remove_comment( $comment_id = 0, $activity_post_object = null ) X-Ref |
Remove an activity item when a comment about a post type is deleted. param: int $comment_id ID of the comment. param: object|null $activity_post_object The post type tracking args object. since: 2.5.0 return: bool True on success. False on error. |
bp_activity_new_comment( $args = '' ) X-Ref |
Add an activity comment. param: array|string $args { since: 1.2.0 since: 2.5.0 Add a new possible parameter $skip_notification for the array of arguments. since: 2.6.0 Added 'error_type' parameter to $args. return: WP_Error|bool|int The ID of the comment on success, otherwise false. |
bp_activity_get_activity_id( $args = '' ) X-Ref |
Fetch the activity_id for an existing activity entry in the DB. param: array|string $args See BP_Activity_Activity::get() for description. since: 1.2.0 return: int $activity_id The ID of the activity item found. |
bp_activity_delete( $args = '' ) X-Ref |
Delete activity item(s). If you're looking to hook into one action that provides the ID(s) of the activity/activities deleted, then use: add_action( 'bp_activity_deleted_activities', 'my_function' ); The action passes one parameter that is a single activity ID or an array of activity IDs depending on the number deleted. If you are deleting an activity comment please use bp_activity_delete_comment(); param: array|string $args To delete specific activity items, use since: 1.0.0 return: bool True on success, false on failure. |
bp_activity_delete_by_item_id( $args = '' ) X-Ref |
Delete an activity item by activity id. You should use bp_activity_delete() instead. param: array|string $args See BP_Activity_Activity::get for a since: 1.1.0 return: bool True on success, false on failure. |
bp_activity_delete_by_activity_id( $activity_id ) X-Ref |
Delete an activity item by activity id. param: int $activity_id ID of the activity item to be deleted. since: 1.1.0 return: bool True on success, false on failure. |
bp_activity_delete_by_content( $user_id, $content, $component, $type ) X-Ref |
Delete an activity item by its content. You should use bp_activity_delete() instead. param: int $user_id The user id. param: string $content The activity id. param: string $component The activity component. param: string $type The activity type. since: 1.1.0 return: bool True on success, false on failure. |
bp_activity_delete_for_user_by_component( $user_id, $component ) X-Ref |
Delete a user's activity for a component. You should use bp_activity_delete() instead. param: int $user_id The user id. param: string $component The activity component. since: 1.1.0 return: bool True on success, false on failure. |
bp_activity_delete_comment( $activity_id, $comment_id ) X-Ref |
Delete an activity comment. param: int $activity_id The ID of the "root" activity, ie the comment's param: int $comment_id The ID of the comment to be deleted. since: 1.2.0 return: bool True on success, false on failure. |
bp_activity_delete_children( $activity_id, $comment_id ) X-Ref |
Delete an activity comment's children. param: int $activity_id The ID of the "root" activity, ie the param: int $comment_id The ID of the comment to be deleted. since: 1.2.0 |
bp_activity_get_permalink( $activity_id, $activity_obj = false ) X-Ref |
Get the permalink for a single activity item. When only the $activity_id param is passed, BP has to instantiate a new BP_Activity_Activity object. To save yourself some processing overhead, be sure to pass the full $activity_obj parameter as well, if you already have it available. param: int $activity_id The unique id of the activity object. param: object|bool $activity_obj Optional. The activity object. since: 1.2.0 return: string $link Permalink for the activity item. |
bp_activity_user_can_read( $activity, $user_id = 0 ) X-Ref |
Can a user see a particular activity item? param: BP_Activity_Activity $activity Activity object. param: integer $user_id User ID. since: 3.0.0 return: boolean True on success, false on failure. |
bp_activity_hide_user_activity( $user_id ) X-Ref |
Hide a user's activity. param: int $user_id The ID of the user whose activity is being hidden. since: 1.2.0 return: bool True on success, false on failure. |
bp_activity_thumbnail_content_images( $content, $link = false, $args = false ) X-Ref |
Take content, remove images, and replace them with a single thumbnail image. The format of items in the activity stream is such that we do not want to allow an arbitrary number of arbitrarily large images to be rendered. However, the activity stream is built to elegantly display a single thumbnail corresponding to the activity comment. This function looks through the content, grabs the first image and converts it to a thumbnail, and removes the rest of the images from the string. As of BuddyPress 2.3, this function is no longer in use. param: string $content The content of the activity item. param: string|bool $link Optional. The unescaped URL that the image should link param: array|bool $args Optional. The args passed to the activity since: 1.2.0 return: string $content The content with images stripped and replaced with a |
bp_activity_get_excerpt_length() X-Ref |
Gets the excerpt length for activity items. since: 2.8.0 return: int Character length for activity excerpts. |
bp_activity_create_summary( $content, $activity ) X-Ref |
Create a rich summary of an activity item for the activity stream. More than just a simple excerpt, the summary could contain oEmbeds and other types of media. Currently, it's only used for blog post items, but it will probably be used for all types of activity in the future. param: string $content The content of the activity item. param: array $activity The data passed to bp_activity_add() or the values since: 2.3.0 return: string $summary |
bp_activity_user_can_mark_spam() X-Ref |
Fetch whether the current user is allowed to mark items as spam. since: 1.6.0 return: bool True if user is allowed to mark activity items as spam. |
bp_activity_mark_as_spam( &$activity, $source = 'by_a_person' ) X-Ref |
Mark an activity item as spam. param: BP_Activity_Activity $activity The activity item to be spammed. param: string $source Optional. Default is "by_a_person" (ie, a person has since: 1.6.0 |
bp_activity_mark_as_ham( &$activity, $source = 'by_a_person' ) X-Ref |
Mark an activity item as ham. param: BP_Activity_Activity $activity The activity item to be hammed. Passed by reference. param: string $source Optional. Default is "by_a_person" (ie, a person has since: 1.6.0 |
bp_activity_at_message_notification( $activity_id, $receiver_user_id ) X-Ref |
Send email and BP notifications when a user is mentioned in an update. param: int $activity_id The ID of the activity update. param: int $receiver_user_id The ID of the user who is receiving the update. since: 1.2.0 |
bp_activity_new_comment_notification( $comment_id = 0, $commenter_id = 0, $params = array() X-Ref |
Send email and BP notifications when an activity item receives a comment. param: int $comment_id The comment id. param: int $commenter_id The ID of the user who posted the comment. param: array $params {@link bp_activity_new_comment()}. since: 1.2.0 since: 2.5.0 Updated to use new email APIs. |
bp_activity_new_comment_notification_helper( $comment_id, $params ) X-Ref |
Helper method to map action arguments to function parameters. param: int $comment_id ID of the comment being notified about. param: array $params Parameters to use with notification. since: 1.9.0 |
bp_activity_embed() X-Ref |
Set up activity oEmbed cache during the activity loop. During an activity loop, this function sets up the hooks necessary to grab each item's embeds from the cache, or put them in the cache if they are not there yet. This does not cover recursive activity comments, as they do not use a real loop. For that, see {@link bp_activity_comment_embed()}. since: 1.5.0 |
bp_activity_oembed_dataparse( $retval, $data ) X-Ref |
Cache full oEmbed response from oEmbed. param: string $retval Current oEmbed result. param: object $data Full oEmbed response. param: string $url URL used for the oEmbed request. since: 2.6.0 return: string |
bp_activity_comment_embed() X-Ref |
Set up activity oEmbed cache while recursing through activity comments. While crawling through an activity comment tree ({@link bp_activity_recurse_comments}), this function sets up the hooks necessary to grab each comment's embeds from the cache, or put them in the cache if they are not there yet. since: 1.5.0 |
bp_dtheme_embed_read_more( $activity ) X-Ref |
When a user clicks on a "Read More" item, make sure embeds are correctly parsed and shown for the expanded content. param: object $activity The activity that is being expanded. since: 1.5.0 |
bp_activity_comment_embed_after_recurse() X-Ref |
Clean up 'embed_post_id' filter after comment recursion. This filter must be removed so that the non-comment filters take over again once the comments are done being processed. since: 1.5.0 |
bp_embed_activity_cache( $cache, $id, $cachekey ) X-Ref |
Fetch an activity item's cached embeds. Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. param: string $cache An empty string passed by BP_Embed::parse_oembed() for param: int $id The ID of the activity item. param: string $cachekey The cache key generated in BP_Embed::parse_oembed(). since: 1.5.0 return: mixed The cached embeds for this activity item. |
bp_embed_activity_save_cache( $cache, $cachekey, $id ) X-Ref |
Set an activity item's embed cache. Used during {@link BP_Embed::parse_oembed()} via {@link bp_activity_embed()}. param: string $cache An empty string passed by BP_Embed::parse_oembed() for param: string $cachekey The cache key generated in BP_Embed::parse_oembed(). param: int $id The ID of the activity item. since: 1.5.0 |
bp_activity_do_heartbeat() X-Ref |
Should we use Heartbeat to refresh activities? since: 2.0.0 return: bool True if activity heartbeat is enabled, otherwise false. |
bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post ) X-Ref |
Detect a change in post type status, and initiate an activity update if necessary. param: string $new_status New status for the post. param: string $old_status Old status for the post. param: object $post Post data. since: 2.2.0 |
bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment ) X-Ref |
When a post type comment status transition occurs, update the relevant activity's status. param: string $new_status New comment status. param: string $old_status Previous comment status. param: WP_Comment $comment Comment data. since: 2.5.0 |
bp_activity_personal_data_exporter( $email_address, $page ) X-Ref |
Finds and exports personal data associated with an email address from the Activity tables. param: string $email_address The user's email address. param: int $page Batch number. since: 4.0.0 return: array An array of personal data. |
bp_activity_is_feed_enable( $feed_id = '' ) X-Ref |
Checks whether an activity feed is enabled. param: string $feed_id The feed identifier. Possible values are: since: 8.0.0 |
Generated: Sun Dec 22 01:00:54 2024 | Cross-referenced by PHPXref 0.7.1 |