Changeset 9078
- Timestamp:
- 10/11/2014 01:08:07 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-admin.php
r8770 r9078 172 172 $hidden = array_merge( (array) $hidden, array( 'bp_activity_itemids', 'bp_activity_link', 'bp_activity_type', 'bp_activity_userid', ) ); 173 173 174 /** 175 * Filters default hidden metaboxes so plugins can alter list. 176 * 177 * @since BuddyPress (1.6.0) 178 * 179 * @param array $hidden Default metaboxes to hide. 180 * @param WP_Screen $screen Screen identifier. 181 */ 174 182 return apply_filters( 'bp_hide_meta_boxes', array_unique( $hidden ), $screen ); 175 183 } … … 199 207 $doaction = bp_admin_list_table_current_bulk_action(); 200 208 201 // Call an action for plugins to hook in early 209 /** 210 * Fires at top of Activity admin page. 211 * 212 * @since BuddyPress (1.6.0) 213 * 214 * @param string $doaction Current $_GET action being performed in admin screen. 215 */ 202 216 do_action( 'bp_activity_admin_load', $doaction ); 203 217 … … 301 315 $activity_ids = array_map( 'absint', (array) $_REQUEST['aid'] ); 302 316 303 // Call a filter for plugins to modify the requested activities to load 317 /** 318 * Filters list of IDs being spammed/un-spammed/deleted. 319 * 320 * @since BuddyPress (1.6.0) 321 * 322 * @param array $activity_ids Activity IDs to spam/un-spam/delete. 323 */ 304 324 $activity_ids = apply_filters( 'bp_activity_admin_action_activity_ids', $activity_ids ); 305 325 … … 385 405 } 386 406 387 // Call actions for plugins to do something before we redirect 407 /** 408 * Fires before redirect for plugins to do something with activity. 409 * 410 * Passes an activity array counts how many were spam, not spam, deleted, and IDs that were errors. 411 * 412 * @since BuddyPress (1.6.0) 413 * 414 * @param array Array holding spam, not spam, deleted counts, error IDs. 415 * @param string $redirect_to URL to redirect to. 416 * @param array $activity_ids Original array of activity IDs. 417 */ 388 418 do_action( 'bp_activity_admin_action_after', array( $spammed, $unspammed, $deleted, $errors ), $redirect_to, $activity_ids ); 389 419 … … 402 432 $redirect_to = add_query_arg( 'error', implode ( ',', array_map( 'absint', $errors ) ), $redirect_to ); 403 433 404 // Redirect 434 /** 435 * Filters redirect URL after activty spamming/un-spamming/deletion occurs. 436 * 437 * @since BuddyPress (1.6.0) 438 * 439 * @param string $redirect_to URL to redirect to. 440 */ 405 441 wp_redirect( apply_filters( 'bp_activity_admin_action_redirect', $redirect_to ) ); 406 442 exit; … … 513 549 $error = $activity->id; 514 550 515 // Call actions for plugins to do something before we redirect 551 /** 552 * Fires before redirect so plugins can do something first on save action. 553 * 554 * @since BuddyPress (1.6.0) 555 * 556 * @param array Array holding activity object and ID that holds error. 557 */ 516 558 do_action_ref_array( 'bp_activity_admin_edit_after', array( &$activity, $error ) ); 517 559 … … 522 564 $redirect_to = add_query_arg( 'updated', (int) $activity->id, $redirect_to ); 523 565 524 // Redirect 566 /** 567 * Filters URL to redirect to after saving. 568 * 569 * @since BuddyPress (1.6.0) 570 * 571 * @param string $redirect_to URL to redirect to. 572 */ 525 573 wp_redirect( apply_filters( 'bp_activity_admin_edit_redirect', $redirect_to ) ); 526 574 exit; … … 587 635 $form_url = add_query_arg( 'action', 'save', $form_url ); 588 636 589 // Call an action for plugins to modify the activity before we display the edit form 637 /** 638 * Fires before activity edit form is displays so plugins can modify the activity. 639 * 640 * @since BuddyPress (1.6.0) 641 * 642 * @param array Array holding single activity object. 643 */ 590 644 do_action_ref_array( 'bp_activity_admin_edit', array( &$activity ) ); ?> 591 645 … … 901 955 $bp_activity_list_table->prepare_items(); 902 956 903 // Call an action for plugins to modify the activity before we display the edit form 957 /** 958 * Fires before edit form is displayed so plugins can modify the activity messages. 959 * 960 * @since BuddyPress (1.6.0) 961 * 962 * @param array $messages Array of messages to display at top of page. 963 */ 904 964 do_action( 'bp_activity_admin_index', $messages ); ?> 905 965 … … 1212 1272 <li class="spam"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'activity_status', 'spam', $url_base ) ) ); ?>" class="<?php if ( 'spam' == $this->view ) echo 'current'; ?>"><?php printf( __( 'Spam <span class="count">(%s)</span>', 'buddypress' ), number_format_i18n( $this->spam_count ) ); ?></a></li> 1213 1273 1214 <?php do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?> 1274 <?php 1275 1276 /** 1277 * Fires inside listing of views so plugins can add their own. 1278 * 1279 * @since BuddyPress (1.6.0) 1280 * 1281 * @param string $url_base Current URL base for view. 1282 * @param string $view Current view being displayed. 1283 */ 1284 do_action( 'bp_activity_list_table_get_views', $url_base, $this->view ); ?> 1215 1285 </ul> 1216 1286 <?php … … 1230 1300 $actions['bulk_delete'] = __( 'Delete Permanently', 'buddypress' ); 1231 1301 1302 /** 1303 * Filters the default bulk actions so plugins can add custom actions. 1304 * 1305 * @since BuddyPress (1.6.0) 1306 * 1307 * @param array $actions Default available actions for bulk operations. 1308 */ 1232 1309 return apply_filters( 'bp_activity_list_table_get_bulk_actions', $actions ); 1233 1310 } … … 1430 1507 echo '<div class="submitted-on">'; 1431 1508 1432 // Other plugins can filter which actions are shown 1509 /** 1510 * Filters available actions for plugins to alter. 1511 * 1512 * @since BuddyPress (1.6.0) 1513 * 1514 * @param array $actions Array of available actions user could use. 1515 * @param array $item Current item being added to page. 1516 */ 1433 1517 $actions = apply_filters( 'bp_activity_admin_comment_row_actions', array_filter( $actions ), $item ); 1434 1518 … … 1441 1525 // Get activity content - if not set, use the action 1442 1526 if ( ! empty( $item['content'] ) ) { 1527 1528 /** 1529 * Filters current activity item content. 1530 * 1531 * @since BuddyPress (1.2.0) 1532 * 1533 * @param array $item Array index holding current activity item content. 1534 */ 1443 1535 $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'] ) ); 1444 1536 } else { 1537 /** 1538 * Filters current activity item action. 1539 * 1540 * @since BuddyPress (1.2.0) 1541 * 1542 * @var array $item Array index holding current activity item action. 1543 */ 1445 1544 $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) ); 1446 1545 } … … 1460 1559 function column_response( $item ) { 1461 1560 // Is $item is a root activity? 1561 1562 /** 1563 * Filters default list of default root activity types. 1564 * 1565 * @since BuddyPress (1.6.0) 1566 * 1567 * @param array Array of default activity types. 1568 * @param array $item Current item being displayed. 1569 */ 1462 1570 if ( empty( $item['item_id'] ) || ! in_array( $item['type'], apply_filters( 'bp_activity_admin_root_activity_types', array( 'activity_comment' ), $item ) ) ) { 1463 1571 $comment_count = !empty( $item['children'] ) ? bp_activity_recurse_comment_count( (object) $item ) : 0; … … 1574 1682 } 1575 1683 1684 /** 1685 * Filters if an activity item can be commented on or not. 1686 * 1687 * @since BuddyPress (2.0.0) 1688 * 1689 * @param bool $can_comment Whether an activity item can be commented on or not. 1690 */ 1576 1691 return apply_filters( 'bp_activity_list_table_can_comment', $can_comment ); 1577 1692 }
Note: See TracChangeset
for help on using the changeset viewer.