Changeset 9079
- Timestamp:
- 10/11/2014 04:08:29 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-actions.php
r8754 r9079 16 16 * Allow core components and dependent plugins to register activity actions. 17 17 * 18 * @since BuddyPress (1.2 )18 * @since BuddyPress (1.2.0) 19 19 * 20 20 * @uses do_action() To call 'bp_register_activity_actions' hook. 21 21 */ 22 22 function bp_register_activity_actions() { 23 24 /** 25 * Fires on bp_init to allow core components and dependent plugins to register activity actions. 26 * 27 * @since BuddyPress (1.2.0) 28 */ 23 29 do_action( 'bp_register_activity_actions' ); 24 30 } … … 97 103 } 98 104 99 // Allow redirect to be filtered 105 /** 106 * Filter the intended redirect url before the redirect occurs for the single activity item. 107 * 108 * @since BuddyPress (1.2.2) 109 * 110 * @param array Array with url to redirect to and activity related to the redirect. 111 */ 100 112 if ( ! $redirect = apply_filters_ref_array( 'bp_activity_permalink_redirect_url', array( $redirect, &$activity ) ) ) { 101 113 bp_core_redirect( bp_get_root_domain() ); … … 150 162 return false; 151 163 152 // Call the action before the delete so plugins can still fetch information about it 164 /** 165 * Fires before the deletion so plugins can still fetch information about it. 166 * 167 * @since BuddyPress (1.5.0) 168 * 169 * @param int $activity_id The activity ID. 170 * @param int $user_id The user associated with the activity. 171 */ 153 172 do_action( 'bp_activity_before_action_delete_activity', $activity_id, $activity->user_id ); 154 173 … … 159 178 bp_core_add_message( __( 'There was an error when deleting that activity', 'buddypress' ), 'error' ); 160 179 180 /** 181 * Fires after the deletion so plugins can act afterwards based on the activity. 182 * 183 * @since BuddyPress (1.1.0) 184 * 185 * @param int $activity_id The activity ID. 186 * @param int $user_id The user associated with the activity. 187 */ 161 188 do_action( 'bp_activity_action_delete_activity', $activity_id, $activity->user_id ); 162 189 … … 204 231 check_admin_referer( 'bp_activity_akismet_spam_' . $activity->id ); 205 232 206 // Call an action before the spamming so plugins can modify things if they want to 233 /** 234 * Fires before the marking activity as spam so plugins can modify things if they want to. 235 * 236 * @since BuddyPress (1.6.0) 237 * 238 * @param int $activty_id Activity ID to be marked as spam. 239 * @param object $activity Activity object for the ID to be marked as spam. 240 */ 207 241 do_action( 'bp_activity_before_action_spam_activity', $activity->id, $activity ); 208 242 … … 214 248 bp_core_add_message( __( 'The activity item has been marked as spam and is no longer visible.', 'buddypress' ) ); 215 249 250 /** 251 * Fires after the marking activity as spam so plugins can act afterwards based on the activity. 252 * 253 * @since BuddyPress (1.6.0) 254 * 255 * @param int $activty_id Activity ID that was marked as spam. 256 * @param int $user_id User ID associated with activity. 257 */ 216 258 do_action( 'bp_activity_action_spam_activity', $activity_id, $activity->user_id ); 217 259 … … 254 296 check_admin_referer( 'post_update', '_wpnonce_post_update' ); 255 297 256 // Get activity info 298 /** 299 * Filters the content provided in the activity input field. 300 * 301 * @since BuddyPress (1.2.0) 302 * 303 * @param string $whats-new Activity message being posted. 304 */ 257 305 $content = apply_filters( 'bp_activity_post_update_content', $_POST['whats-new'] ); 258 306 259 307 if ( ! empty( $_POST['whats-new-post-object'] ) ) { 308 309 /** 310 * Filters the item type that the activity update should be associated with. 311 * 312 * @since BuddyPress (1.2.0) 313 * 314 * @param string $whats-new-post-object Item type to associate with. 315 */ 260 316 $object = apply_filters( 'bp_activity_post_update_object', $_POST['whats-new-post-object'] ); 261 317 } 262 318 263 319 if ( ! empty( $_POST['whats-new-post-in'] ) ) { 320 321 /** 322 * Filters what component the activity is being to. 323 * 324 * @since BuddyPress (1.2.0) 325 * 326 * @param string $whats-new-post-in Chosen component to post activity to. 327 */ 264 328 $item_id = apply_filters( 'bp_activity_post_update_item_id', $_POST['whats-new-post-in'] ); 265 329 } … … 281 345 } 282 346 283 // Special circumstance so let filters handle it284 347 } else { 348 349 /** 350 * Filters activity object for BuddyPress core and plugin authors before posting activity update. 351 * 352 * @since BuddyPress (1.2.0) 353 * 354 * @param string $object Activity item being associated to. 355 * @param string $item_id Component ID being posted to. 356 * @param string $content Activity content being posted. 357 */ 285 358 $activity_id = apply_filters( 'bp_activity_custom_update', $object, $item_id, $content ); 286 359 } … … 323 396 check_admin_referer( 'new_activity_comment', '_wpnonce_new_activity_comment' ); 324 397 398 /** 399 * Filters the activity ID a comment will be in reply to. 400 * 401 * @since BuddyPress (1.2.0) 402 * 403 * @param string $comment_form_id ID of the activity being replied to. 404 */ 325 405 $activity_id = apply_filters( 'bp_activity_post_comment_activity_id', $_POST['comment_form_id'] ); 406 407 /** 408 * Filters the comment content for a comment reply. 409 * 410 * @since BuddyPress (1.2.0) 411 * 412 * @param string $ac_input_activity_id Comment content being posted. 413 */ 326 414 $content = apply_filters( 'bp_activity_post_comment_content', $_POST['ac_input_' . $activity_id] ); 327 415 … … 641 729 return; 642 730 643 // Bail if BuddyPress Activity Akismet support has been disabled by another plugin 731 /** 732 * Filters if BuddyPress Activity Akismet support has been disabled by another plugin. 733 * 734 * @since BuddyPress (1.6.0) 735 * 736 * @param bool bp_is_akismet_active Return value of bp_is_akismet_active boolean function. 737 */ 644 738 if ( ! apply_filters( 'bp_activity_use_akismet', bp_is_akismet_active() ) ) 645 739 return;
Note: See TracChangeset
for help on using the changeset viewer.