Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/07/2016 04:47:35 PM (9 years ago)
Author:
imath
Message:

Post Type Activities: generalize the Blogs component "post" comment synchronization feature to any post type.

As soon as the Blogs component is active and activity comments about Post Type activities are not disallowed, a new comment added to a post type will generate an activity comment about the corresponding Post Type Activity and vice versa.

Deprecate the Blogs component functions previously used to track the "post" post type in favor of the Activity component functions introduced in r10543.

Only load the Blogs component activity functions if the Activity component is active.

Make sure a synchronized activity comment marked as spam is also marking as spam the corresponding post type comment.

NB: some unit tests will temporarly fail after this commit. Next commit will fix the failing tests.

Props shanebp, r-a-y.

See #6482
Fixes #6793

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/deprecated/2.5.php

    r10540 r10544  
    874874}
    875875add_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 );
     876
     877/**
     878 * When a blog comment status transition occurs, update the relevant activity's status.
     879 *
     880 * @since 1.6.0
     881 * @deprecated 2.5.0
     882 *
     883 * @param string $new_status New comment status.
     884 * @param string $old_status Previous comment status.
     885 * @param object $comment Comment data.
     886 */
     887function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
     888    _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_transition_post_type_comment_status()' );
     889    bp_activity_transition_post_type_comment_status( $new_status, $old_status, $comment );
     890}
     891
     892/**
     893 * Record a new blog comment in the BuddyPress activity stream.
     894 *
     895 * Only posts the item if blog is public and post is not password-protected.
     896 *
     897 * @deprecated 2.5.0
     898 *
     899 * @param int $comment_id ID of the comment being recorded.
     900 * @param bool|string $is_approved Optional. The $is_approved value passed to
     901 *        the 'comment_post' action. Default: true.
     902 * @return bool|object Returns false on failure, the comment object on success.
     903 */
     904function bp_blogs_record_comment( $comment_id, $is_approved = true ) {
     905    _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_post_type_comment()' );
     906    bp_activity_post_type_comment( $comment_id, $is_approved );
     907}
     908
     909/**
     910 * Remove a blog comment activity item from the activity stream.
     911 *
     912 * @deprecated 2.5.0
     913 *
     914 * @param int $comment_id ID of the comment to be removed.
     915 */
     916function bp_blogs_remove_comment( $comment_id ) {
     917    _deprecated_function( __FUNCTION__, '2.5.0', 'bp_activity_post_type_remove_comment()' );
     918    bp_activity_post_type_remove_comment( $comment_id );
     919}
Note: See TracChangeset for help on using the changeset viewer.