Changeset 9487
- Timestamp:
- 02/17/2015 05:16:34 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-groups/bp-groups-admin.php
r9466 r9487 82 82 $doaction = bp_admin_list_table_current_bulk_action(); 83 83 84 // Call an action for plugins to hook in early 84 /** 85 * Fires at top of groups admin page. 86 * 87 * @since BuddyPress (1.7.0) 88 * 89 * @param string $doaction Current $_GET action being performed in admin screen. 90 */ 85 91 do_action( 'bp_groups_admin_load', $doaction ); 86 92 … … 127 133 add_meta_box( 'bp_group_members', _x( 'Manage Members', 'group admin edit screen', 'buddypress' ), 'bp_groups_admin_edit_metabox_members', get_current_screen()->id, 'normal', 'core' ); 128 134 135 /** 136 * Fires after the registration of all of the default group meta boxes. 137 * 138 * @since BuddyPress (1.7.0) 139 */ 129 140 do_action( 'bp_groups_admin_meta_boxes' ); 130 141 … … 226 237 $enable_forum = ( isset( $_POST['group-show-forum'] ) ) ? 1 : 0; 227 238 228 // Privacy setting 239 /** 240 * Filters the allowed status values for the group. 241 * 242 * @since BuddyPress (1.0.2) 243 * 244 * @param array $value Array of allowed group statuses. 245 */ 229 246 $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) ); 230 247 $status = ( in_array( $_POST['group-status'], (array) $allowed_status ) ) ? $_POST['group-status'] : 'public'; 231 248 232 249 // Invite status 250 /** 251 * Filters the allowed invite status values for the group. 252 * 253 * @since BuddyPress (1.5.0) 254 * 255 * @param array $value Array of allowed invite statuses. 256 */ 233 257 $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) ); 234 258 $invite_status = in_array( $_POST['group-invite-status'], (array) $allowed_invite_status ) ? $_POST['group-invite-status'] : 'members'; … … 348 372 } 349 373 350 // Call actions for plugins to do something before we redirect 374 /** 375 * Fires before redirect so plugins can do something first on save action. 376 * 377 * @since BuddyPress (1.6.0) 378 * 379 * @param int $group_id ID of the group being edited. 380 */ 351 381 do_action( 'bp_group_admin_edit_after', $group_id ); 352 382 … … 381 411 } 382 412 383 // Redirect 413 /** 414 * Filters the URL to redirect to after successfully editing a group. 415 * 416 * @since BuddyPress (1.7.0) 417 * 418 * @param string $redirect_to URL to redirect user to. 419 */ 384 420 wp_redirect( apply_filters( 'bp_group_admin_edit_redirect', $redirect_to ) ); 385 421 exit; … … 510 546 // Get the group from the database 511 547 $group = groups_get_group( 'group_id=' . $_GET['gid'] ); 548 549 /** This filter is documented in bp-groups/bp-groups-template.php */ 512 550 $group_name = isset( $group->name ) ? apply_filters( 'bp_get_group_name', $group->name ) : ''; 513 551 … … 516 554 $form_url = add_query_arg( 'action', 'save', $form_url ); 517 555 518 // Call an action for plugins to modify the group before we display the edit form 556 /** 557 * Fires before the display of the edit form. 558 * 559 * Useful for plugins to modify the group before display. 560 * 561 * @since BuddyPress (1.7.0) 562 * 563 * @param BP_Groups_Group Instance of the current group being edited. Passed by reference. 564 */ 519 565 do_action_ref_array( 'bp_groups_admin_edit', array( &$group ) ); ?> 520 566 … … 662 708 $bp_groups_list_table->prepare_items(); 663 709 664 // Call an action for plugins to modify the messages before we display the edit form 710 /** 711 * Fires before the display of messages for the edit form. 712 * 713 * Useful for plugins to modify the messages before display. 714 * 715 * @since BuddyPress (1.7.0) 716 * 717 * @param array $messages Array of messages to be displayed. 718 */ 665 719 do_action( 'bp_groups_admin_index', $messages ); ?> 666 720 … … 876 930 <tr> 877 931 <td colspan="3"> 878 <?php do_action( 'bp_groups_admin_manage_member_row', $type_user->ID, $item ); ?> 932 <?php 933 934 /** 935 * Fires after the listing of a single row for members in a group on the group edit screen. 936 * 937 * @since BuddyPress (1.8.0) 938 * 939 * @param int $ID ID of the user being rendered. 940 * @param BP_Groups_Group $item Object for the current group. 941 */ 942 do_action( 'bp_groups_admin_manage_member_row', $type_user->ID, $item ); ?> 879 943 </td> 880 944 </tr> … … 1276 1340 } 1277 1341 1342 /** 1343 * Filters the classes applied to a single row in the groups list table. 1344 * 1345 * @since BuddyPress (1.9.0) 1346 * 1347 * @param array $row_classes Array of classes to apply to the row. 1348 * @param string $value ID of the current group being displayed. 1349 */ 1278 1350 $row_classes = apply_filters( 'bp_groups_admin_row_class', $row_classes, $item['id'] ); 1279 1351 $row_class = ' class="' . implode( ' ', $row_classes ) . '"'; … … 1300 1372 <li class="hidden"><a href="<?php echo esc_attr( esc_url( add_query_arg( 'group_status', 'hidden', $url_base ) ) ); ?>" class="<?php if ( 'hidden' == $this->view ) echo 'current'; ?>"><?php printf( _n( 'Hidden <span class="count">(%s)</span>', 'Hidden <span class="count">(%s)</span>', $this->group_counts['hidden'], 'buddypress' ), number_format_i18n( $this->group_counts['hidden'] ) ); ?></a></li> 1301 1373 1302 <?php do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?> 1374 <?php 1375 1376 /** 1377 * Fires inside listing of views so plugins can add their own. 1378 * 1379 * @since BuddyPress (1.7.0) 1380 * 1381 * @param string $url_base Current URL base for view. 1382 * @param string $view Current view being displayed. 1383 */ 1384 do_action( 'bp_groups_list_table_get_views', $url_base, $this->view ); ?> 1303 1385 </ul> 1304 1386 <?php … … 1313 1395 */ 1314 1396 public function get_bulk_actions() { 1397 1398 /** 1399 * Filters the list of bulk actions to display on a single group row. 1400 * 1401 * @since BuddyPress (1.7.0) 1402 * 1403 * @param array $value Array of bulk actions to display. 1404 */ 1315 1405 return apply_filters( 'bp_groups_list_table_get_bulk_actions', array( 1316 1406 'delete' => __( 'Delete', 'buddypress' ) … … 1328 1418 */ 1329 1419 public function get_columns() { 1420 1421 /** 1422 * Filters the titles for the columns for the groups list table. 1423 * 1424 * @since BuddyPress (2.0.0) 1425 * 1426 * @param array $value Array of slugs and titles for the columns. 1427 */ 1330 1428 return apply_filters( 'bp_groups_list_table_get_columns', array( 1331 1429 'cb' => '<input name type="checkbox" />', … … 1417 1515 $edit_url = $base_url . '&action=edit'; 1418 1516 $view_url = bp_get_group_permalink( $item_obj ); 1517 1518 /** 1519 * Filters the group name for a group's column content. 1520 * 1521 * @since BuddyPress (1.7.0) 1522 * 1523 * @param string $value Name of the group being rendered. 1524 * @param array $item Array for the current group item. 1525 */ 1419 1526 $group_name = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'] ), $item ); 1420 1527 … … 1430 1537 $actions['view'] = sprintf( '<a href="%s">%s</a>', esc_url( $view_url ), __( 'View', 'buddypress' ) ); 1431 1538 1432 // Other plugins can filter which actions are shown 1539 /** 1540 * Filters the actions that will be shown for the column content. 1541 * 1542 * @since BuddyPress (1.7.0) 1543 * 1544 * @param array $value Array of actions to be displayed for the column content. 1545 * @param array $item The current group item in the loop. 1546 */ 1433 1547 $actions = apply_filters( 'bp_groups_admin_comment_row_actions', array_filter( $actions ), $item ); 1434 1548 … … 1462 1576 */ 1463 1577 public function column_description( $item = array() ) { 1578 1579 /** 1580 * Filters the markup for the Description column. 1581 * 1582 * @since BuddyPress (1.0.0) 1583 * 1584 * @param string $value Markup for the Description column. 1585 * @parma array $item The current group item in the loop. 1586 */ 1464 1587 echo apply_filters_ref_array( 'bp_get_group_description', array( $item['description'], $item ) ); 1465 1588 } … … 1490 1613 } 1491 1614 1615 /** 1616 * Filters the markup for the Status column. 1617 * 1618 * @since BuddyPress (1.7.0) 1619 * 1620 * @param string $status_desc Markup for the Status column. 1621 * @parma array $item The current group item in the loop. 1622 */ 1492 1623 echo apply_filters_ref_array( 'bp_groups_admin_get_group_status', array( $status_desc, $item ) ); 1493 1624 } … … 1502 1633 public function column_members( $item = array() ) { 1503 1634 $count = groups_get_groupmeta( $item['id'], 'total_member_count' ); 1635 1636 /** 1637 * Filters the markup for the number of Members column. 1638 * 1639 * @since BuddyPress (1.7.0) 1640 * 1641 * @param int $count Markup for the number of Members column. 1642 * @parma array $item The current group item in the loop. 1643 */ 1504 1644 echo apply_filters_ref_array( 'bp_groups_admin_get_group_member_count', array( (int) $count, $item ) ); 1505 1645 } … … 1514 1654 public function column_last_active( $item = array() ) { 1515 1655 $last_active = groups_get_groupmeta( $item['id'], 'last_activity' ); 1656 1657 /** 1658 * Filters the markup for the Last Active column. 1659 * 1660 * @since BuddyPress (1.7.0) 1661 * 1662 * @param string $last_active Markup for the Last Active column. 1663 * @parma array $item The current group item in the loop. 1664 */ 1516 1665 echo apply_filters_ref_array( 'bp_groups_admin_get_group_last_active', array( $last_active, $item ) ); 1517 1666 } … … 1520 1669 * Allow plugins to add their custom column. 1521 1670 * 1522 * @since BuddyPress 2.0.01671 * @since BuddyPress (2.0.0) 1523 1672 * 1524 1673 * @param array Information about the current row. 1525 1674 * @param string the column name. 1675 * 1676 * @return string 1526 1677 */ 1527 1678 public function column_default( $item = array(), $column_name = '' ) { 1679 1680 /** 1681 * Filters a string to allow plugins to add custom column content. 1682 * 1683 * @since BuddyPress (2.0.0) 1684 * 1685 * @param string $value Empty string. 1686 * @param string $column_name Name of the column being rendered. 1687 * @param array $item The current group item in the loop. 1688 */ 1528 1689 return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item ); 1529 1690 }
Note: See TracChangeset
for help on using the changeset viewer.