Changeset 8520
- Timestamp:
- 06/15/2014 01:01:44 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-functions.php
r8519 r8520 1132 1132 'is_spam' => false, // Is this activity item to be marked as spam? 1133 1133 ); 1134 $params = wp_parse_args( $args, $defaults ); 1135 extract( $params, EXTR_SKIP ); 1134 $r = wp_parse_args( $args, $defaults ); 1136 1135 1137 1136 // Make sure we are backwards compatible 1138 if ( empty( $ component ) && !empty( $component_name) )1139 $ component = $component_name;1140 1141 if ( empty( $ type ) && !empty( $component_action) )1142 $ type = $component_action;1137 if ( empty( $r['component'] ) && !empty( $r['component_name'] ) ) 1138 $r['component'] = $r['component_name']; 1139 1140 if ( empty( $r['type'] ) && !empty( $r['component_action'] ) ) 1141 $r['type'] = $r['component_action']; 1143 1142 1144 1143 // Setup activity to be added 1145 $activity = new BP_Activity_Activity( $ id);1146 $activity->user_id = $ user_id;1147 $activity->component = $ component;1148 $activity->type = $ type;1149 $activity->content = $ content;1150 $activity->primary_link = $ primary_link;1151 $activity->item_id = $ item_id;1152 $activity->secondary_item_id = $ secondary_item_id;1153 $activity->date_recorded = $r ecorded_time;1154 $activity->hide_sitewide = $ hide_sitewide;1155 $activity->is_spam = $ is_spam;1156 $activity->action = ! empty( $ action ) ? $action: bp_activity_generate_action_string( $activity );1144 $activity = new BP_Activity_Activity( $r['id'] ); 1145 $activity->user_id = $r['user_id']; 1146 $activity->component = $r['component']; 1147 $activity->type = $r['type']; 1148 $activity->content = $r['content']; 1149 $activity->primary_link = $r['primary_link']; 1150 $activity->item_id = $r['item_id']; 1151 $activity->secondary_item_id = $r['secondary_item_id']; 1152 $activity->date_recorded = $r['recorded_time']; 1153 $activity->hide_sitewide = $r['hide_sitewide']; 1154 $activity->is_spam = $r['is_spam']; 1155 $activity->action = ! empty( $r['action'] ) ? $r['action'] : bp_activity_generate_action_string( $activity ); 1157 1156 1158 1157 if ( !$activity->save() ) … … 1164 1163 1165 1164 wp_cache_delete( 'bp_activity_sitewide_front', 'bp' ); 1166 do_action( 'bp_activity_add', $ params);1165 do_action( 'bp_activity_add', $r ); 1167 1166 1168 1167 return $activity->id;
Note: See TracChangeset
for help on using the changeset viewer.