diff --git src/bp-activity/bp-activity-actions.php src/bp-activity/bp-activity-actions.php
index 2a04601..17f23e6 100644
--- src/bp-activity/bp-activity-actions.php
+++ src/bp-activity/bp-activity-actions.php
@@ -766,3 +766,47 @@ function bp_ajax_get_suggestions() {
wp_send_json_success( $results );
}
add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
+
+/**
+ * Detect a change in post type status, and initiate an activity update if necessary.
+ *
+ * @since BuddyPress (2.2.0)
+ *
+ * @todo Support untrashing better.
+ *
+ * @param string $new_status New status for the post.
+ * @param string $old_status Old status for the post.
+ * @param object $post Post data.
+ */
+function bp_activity_catch_transition_post_type_status( $new_status, $old_status, $post ) {
+ if ( ! post_type_supports( $post->post_type, 'buddypress-activity' ) ) {
+ return;
+ }
+
+ // This is an edit.
+ if ( $new_status === $old_status ) {
+ // An edit of an existing post should update the existing activity item.
+ if ( $new_status == 'publish' ) {
+ bp_activity_post_type_update( $post );
+ }
+
+ return;
+ }
+
+ // Publishing a previously unpublished post.
+ if ( 'publish' === $new_status ) {
+ // Untrashing the post type - nothing here yet.
+ if ( 'trash' == $old_status ) {
+ do_action( 'bp_activity_post_type_untrash_' . $post->post_type, $post );
+ } else {
+ // Record the post.
+ bp_activity_post_type_publish( $post->ID, $post );
+ }
+
+ // Unpublishing a previously published post.
+ } else if ( 'publish' === $old_status ) {
+ // Some form of pending status - only remove the activity entry
+ bp_activity_post_type_unpublish( $post->ID, $post );
+ }
+}
+add_action( 'transition_post_status', 'bp_activity_catch_transition_post_type_status', 10, 3 );
diff --git src/bp-activity/bp-activity-admin.php src/bp-activity/bp-activity-admin.php
index 5eb6c48..4386b28 100644
--- src/bp-activity/bp-activity-admin.php
+++ src/bp-activity/bp-activity-admin.php
@@ -798,7 +798,7 @@ function bp_activity_admin_get_activity_actions() {
$actions = array();
// Walk through the registered actions, and build an array of actions/values.
- foreach ( buddypress()->activity->actions as $action ) {
+ foreach ( bp_activity_get_actions() as $action ) {
$action = array_values( (array) $action );
for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ ) {
@@ -831,7 +831,7 @@ function bp_activity_admin_edit_metabox_type( $item ) {
$selected = $item->type;
// Walk through the registered actions, and build an array of actions/values.
- foreach ( $bp->activity->actions as $action ) {
+ foreach ( bp_activity_get_actions() as $action ) {
$action = array_values( (array) $action );
for ( $i = 0, $i_count = count( $action ); $i < $i_count; $i++ )
@@ -1365,7 +1365,7 @@ class BP_Activity_List_Table extends WP_List_Table {
$selected = ( ! empty( $_REQUEST['activity_type'] ) ) ? $_REQUEST['activity_type'] : '';
// Get the actions
- $activity_actions = buddypress()->activity->actions; ?>
+ $activity_actions = bp_activity_get_actions(); ?>