diff --git a/src/bp-activity/bp-activity-admin.php b/src/bp-activity/bp-activity-admin.php
index 1f64825..fb062d5 100644
a
|
b
|
function bp_activity_admin_load() { |
580 | 580 | if ( $error ) |
581 | 581 | $redirect_to = add_query_arg( 'error', (int) $error, $redirect_to ); |
582 | 582 | else |
583 | | $redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to ); |
| 583 | $redirect_to = add_query_arg( 'updated', $activity->id, $redirect_to ); |
584 | 584 | |
585 | 585 | /** |
586 | 586 | * Filters URL to redirect to after saving. |
diff --git a/src/bp-activity/bp-activity-functions.php b/src/bp-activity/bp-activity-functions.php
index caf506f..359953d 100644
a
|
b
|
function bp_activity_new_comment( $args = '' ) { |
2633 | 2633 | } |
2634 | 2634 | |
2635 | 2635 | // Check to see if the parent activity is hidden, and if so, hide this comment publicly. |
2636 | | $is_hidden = ( (int) $activity->hide_sitewide ) ? 1 : 0; |
| 2636 | $is_hidden = $activity->hide_sitewide ? 1 : 0; |
2637 | 2637 | |
2638 | 2638 | /** |
2639 | 2639 | * Filters the content of a new comment. |
diff --git a/src/bp-activity/bp-activity-template.php b/src/bp-activity/bp-activity-template.php
index b4240b2..ad746d1 100644
a
|
b
|
function bp_activity_user_can_delete( $activity = false ) { |
1652 | 1652 | // Users are allowed to delete their own activity. This is actually |
1653 | 1653 | // quite powerful, because doing so also deletes all comments to that |
1654 | 1654 | // activity item. We should revisit this eventually. |
1655 | | if ( isset( $activity->user_id ) && ( (int) $activity->user_id === bp_loggedin_user_id() ) ) { |
| 1655 | if ( isset( $activity->user_id ) && $activity->user_id === bp_loggedin_user_id() ) { |
1656 | 1656 | $can_delete = true; |
1657 | 1657 | } |
1658 | 1658 | |
diff --git a/src/bp-activity/classes/class-bp-activity-activity.php b/src/bp-activity/classes/class-bp-activity-activity.php
index a4e82ba..da51587 100644
a
|
b
|
class BP_Activity_Activity { |
107 | 107 | * @since 1.1.0 |
108 | 108 | * @var int |
109 | 109 | */ |
110 | | var $hide_sitewide = false; |
| 110 | var $hide_sitewide = 0; |
111 | 111 | |
112 | 112 | /** |
113 | 113 | * Node boundary start for activity or activity comment. |
… |
… |
class BP_Activity_Activity { |
708 | 708 | |
709 | 709 | // Now fetch data from the cache. |
710 | 710 | foreach ( $activity_ids as $activity_id ) { |
711 | | $activities[] = wp_cache_get( $activity_id, 'bp_activity' ); |
| 711 | $activity = wp_cache_get( $activity_id, 'bp_activity' ); |
| 712 | $activity->hide_sitewide = (int) $activity->hide_sitewide; |
| 713 | $activity->id = (int) $activity->id; |
| 714 | $activity->is_spam = (int) $activity->is_spam; |
| 715 | $activity->item_id = (int) $activity->item_id; |
| 716 | $activity->mptt_left = (int) $activity->mptt_left; |
| 717 | $activity->mptt_right = (int) $activity->mptt_right; |
| 718 | $activity->secondary_item_id = (int) $activity->secondary_item_id; |
| 719 | $activity->user_id = (int) $activity->user_id; |
| 720 | |
| 721 | $activities[] = $activity; |
712 | 722 | } |
713 | 723 | |
714 | 724 | // Then fetch user data. |
diff --git a/src/bp-blogs/bp-blogs-activity.php b/src/bp-blogs/bp-blogs-activity.php
index b822f50..143593e 100644
a
|
b
|
function bp_blogs_sync_activity_edit_to_post_comment( BP_Activity_Activity $acti |
830 | 830 | remove_action( 'transition_comment_status', 'bp_activity_transition_post_type_comment_status', 10, 3 ); |
831 | 831 | remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment', 10, 4 ); |
832 | 832 | |
833 | | if ( 1 === (int) $activity->is_spam && 'spam' !== $post_comment_status ) { |
| 833 | if ( 1 === $activity->is_spam && 'spam' !== $post_comment_status ) { |
834 | 834 | wp_spam_comment( $post_comment_id ); |
835 | 835 | } elseif ( ! $activity->is_spam ) { |
836 | 836 | if ( 'spam' === $post_comment_status ) { |