Skip to:
Content

BuddyPress.org

Changeset 7561


Ignore:
Timestamp:
11/11/2013 02:24:01 AM (11 years ago)
Author:
boonebgorges
Message:

Improve inline docs in bp-groups component. See #5022

Location:
trunk/bp-groups
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-actions.php

    r7384 r7561  
    44 * BuddyPress Groups Actions
    55 *
    6  * Action functions are exactly the same as screen functions, however they do not
    7  * have a template screen associated with them. Usually they will send the user
    8  * back to the default screen after execution.
     6 * Action functions are exactly the same as screen functions, however they do
     7 * not have a template screen associated with them. Usually they will send the
     8 * user back to the default screen after execution.
    99 *
    1010 * @package BuddyPress
     
    1515if ( !defined( 'ABSPATH' ) ) exit;
    1616
     17/**
     18 * Catch and process group creation form submissions.
     19 */
    1720function groups_action_create_group() {
    1821    global $bp;
     
    239242
    240243/**
     244 * Catch and process "Leave Group" button clicks.
     245 *
    241246 * When a group member clicks on the "Leave Group" button from a group's page,
    242247 * this function is run.
     
    285290add_action( 'bp_actions', 'groups_action_leave_group' );
    286291
    287 
     292/**
     293 * Sort the group creation steps.
     294 */
    288295function groups_action_sort_creation_steps() {
    289296    global $bp;
     
    311318
    312319/**
    313  * Catches requests for a random group page (example.com/groups/?random-group) and redirects
     320 * Catch requests for a random group page (example.com/groups/?random-group) and redirect.
    314321 */
    315322function groups_action_redirect_to_random_group() {
     
    324331
    325332/**
    326  * Load the activity feed for the specific group.
    327  *
    328  * @since BuddyPress (v1.2)
     333 * Load the activity feed for the current group.
     334 *
     335 * @since BuddyPress (1.2.0)
    329336 */
    330337function groups_action_group_feed() {
  • trunk/bp-groups/bp-groups-activity.php

    r7077 r7561  
    1414if ( !defined( 'ABSPATH' ) ) exit;
    1515
     16/**
     17 * Register activity actions for the Groups component.
     18 */
    1619function groups_register_activity_actions() {
    1720    global $bp;
     
    3639add_action( 'bp_register_activity_actions', 'groups_register_activity_actions' );
    3740
     41/**
     42 * Record an activity item related to the Groups component.
     43 *
     44 * A wrapper for {@link bp_activity_add()} that provides some Groups-specific
     45 * defaults.
     46 *
     47 * @see bp_activity_add() for more detailed description of parameters and
     48 *      return values.
     49 *
     50 * @param array $args {
     51 *     An array of arguments for the new activity item. Accepts all parameters
     52 *     of {@link bp_activity_add()}. However, this wrapper provides some
     53 *     additional defaults, as described below:
     54 *     @type string $component Default: the id of your Groups component
     55 *           (usually 'groups').
     56 *     @type bool $hide_sitewide Default: True if the current group is not
     57 *           public, otherwise false.
     58 * }
     59 * @return bool See {@link bp_activity_add()}.
     60 */
    3861function groups_record_activity( $args = '' ) {
    3962    global $bp;
     
    7699}
    77100
     101/**
     102 * Update the last_activity meta value for a given group.
     103 *
     104 * @param int $group_id Optional. The ID of the group whose last_activity is
     105 *        being updated. Default: the current group's ID.
     106 */
    78107function groups_update_last_activity( $group_id = 0 ) {
    79108    global $bp;
  • trunk/bp-groups/bp-groups-admin.php

    r7478 r7561  
    33 * BuddyPress Groups component admin screen
    44 *
    5  * Props to WordPress core for the Comments admin screen, and its contextual help text,
    6  * on which this implementation is heavily based.
     5 * Props to WordPress core for the Comments admin screen, and its contextual
     6 * help text, on which this implementation is heavily based.
    77 *
    88 * @package BuddyPress
    9  * @since BuddyPress (1.7)
     9 * @since BuddyPress (1.7.0)
    1010 * @subpackage Groups
    1111 */
     
    2222
    2323/**
    24  * Registers the Groups component admin screen
    25  *
    26  * @since BuddyPress (1.7)
     24 * Register the Groups component admin screen.
     25 *
     26 * @since BuddyPress (1.7.0)
    2727 */
    2828function bp_groups_add_admin_menu() {
     
    4444
    4545/**
    46  * Add groups component to custom menus array
    47  *
    48  * @since BuddyPress (1.7)
    49  *
    50  * @param array $custom_menus
    51  * @return array
     46 * Add groups component to custom menus array.
     47 *
     48 * This ensures that the Groups menu item appears in the proper order on the
     49 * main Dashboard menu.
     50 *
     51 * @since BuddyPress (1.7.0)
     52 *
     53 * @param array $custom_menus Array of BP top-level menu items.
     54 * @return array Menu item array, with Groups added.
    5255 */
    5356function bp_groups_admin_menu_order( $custom_menus = array() ) {
     
    5861
    5962/**
    60  * Set up the admin page before any output is sent. Register contextual help and screen options for this admin page.
     63 * Set up the Groups admin page.
     64 *
     65 * Loaded before the page is rendered, this function does all initial setup,
     66 * including: processing form requests, registering contextual help, and
     67 * setting up screen options.
     68 *
     69 * @since BuddyPress (1.7.0)
    6170 *
    6271 * @global object $bp BuddyPress global settings
    6372 * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table
    64  * @since BuddyPress (1.7)
    6573 */
    6674function bp_groups_admin_load() {
     
    376384
    377385/**
    378  * Handle save/update of screen options for the Groups component admin screen
    379  *
    380  * @since BuddyPress (1.7)
     386 * Handle save/update of screen options for the Groups component admin screen.
     387 *
     388 * @since BuddyPress (1.7.0)
    381389 *
    382390 * @param string $value Will always be false unless another plugin filters it first.
    383  * @param string $option Screen option name
    384  * @param string $new_value Screen option form value
     391 * @param string $option Screen option name.
     392 * @param string $new_value Screen option form value.
    385393 * @return string Option value. False to abandon update.
    386394 */
     
    398406
    399407/**
    400  * Outputs the Groups component admin screens
    401  *
    402  * @since BuddyPress (1.7)
     408 * Select the appropirate Groups admin screen, and output it.
     409 *
     410 * @since BuddyPress (1.7.0)
    403411 */
    404412function bp_groups_admin() {
     
    421429
    422430/**
    423  * Display the single groups edit screen
    424  *
    425  * @since BuddyPress (1.7)
     431 * Display the single groups edit screen.
     432 *
     433 * @since BuddyPress (1.7.0)
    426434 */
    427435function bp_groups_admin_edit() {
     
    544552
    545553/**
    546  * Display the Group delete confirmation screen
     554 * Display the Group delete confirmation screen.
    547555 *
    548556 * We include a separate confirmation because group deletion is truly
    549557 * irreversible.
    550558 *
    551  * @since (BuddyPress) 1.7
     559 * @since BuddyPress (1.7.0)
    552560 */
    553561function bp_groups_admin_delete() {
     
    592600
    593601/**
    594  * Display the Groups admin index screen, which contains a list of all your
    595  * BuddyPress groups.
    596  *
    597  * @global BP_Group_List_Table $bp_groups_list_table Group screen list table
    598  * @global string $plugin_page
    599  * @since BuddyPress (1.7)
     602 * Display the Groups admin index screen.
     603 *
     604 * This screen contains a list of all BuddyPress groups.
     605 *
     606 * @since BuddyPress (1.7.0)
     607 *
     608 * @global BP_Group_List_Table $bp_groups_list_table Group screen list table.
     609 * @global string $plugin_page Currently viewed plugin page.
    600610 */
    601611function bp_groups_admin_index() {
     
    653663
    654664/**
    655  * Settings metabox
    656  *
    657  * @param object $item Group item
    658  * @since BuddyPress (1.7)
     665 * Markup for the single group's Settings metabox.
     666 *
     667 * @since BuddyPress (1.7.0)
     668 *
     669 * @param object $item Information about the current group.
    659670 */
    660671function bp_groups_admin_edit_metabox_settings( $item ) {
     
    691702
    692703/**
    693  * Add New Members metabox
    694  *
    695  * @since BuddyPress (1.7)
     704 * Output the markup for a single group's Add New Members metabox.
     705 *
     706 * @since BuddyPress (1.7.0)
    696707 */
    697708function bp_groups_admin_edit_metabox_add_new_members( $item ) {
     
    704715
    705716/**
    706  * Members metabox
    707  *
    708  * @param BP_Groups_Group $item The BP_Groups_Group object
    709  *
    710  * @since BuddyPress (1.7)
     717 * Renders the Members metabox on single group pages.
     718 *
     719 * @since BuddyPress (1.7.0)
     720 *
     721 * @param BP_Groups_Group $item The BP_Groups_Group object for the current
     722 *        group.
    711723 */
    712724function bp_groups_admin_edit_metabox_members( $item ) {
     
    844856
    845857/**
    846  * Status metabox for the Groups admin edit screen
    847  *
    848  * @param object $item Group item
    849  * @since BuddyPress (1.7)
     858 * Renders the Status metabox for the Groups admin edit screen.
     859 *
     860 * @since BuddyPress (1.7.0)
     861 *
     862 * @param object $item Information about the currently displayed group.
    850863 */
    851864function bp_groups_admin_edit_metabox_status( $item ) {
     
    872885
    873886/**
    874  * Create pagination links out of a BP_Group_Member_Query
     887 * Create pagination links out of a BP_Group_Member_Query.
    875888 *
    876889 * This function is intended to create pagination links for use under the
     
    880893 * deprecated soon.
    881894 *
    882  * @since BuddyPress (1.8)
    883  * @param object $query A BP_Group_Member_Query object
    884  * @param string $member_type member|mod|admin|banned
     895 * @since BuddyPress (1.8.0)
     896 *
     897 * @param BP_Group_Member_Query $query A BP_Group_Member_Query object.
     898 * @param string $member_type member|mod|admin|banned.
     899 * @return string Pagination links HTML.
    885900 */
    886901function bp_groups_admin_create_pagination_links( BP_Group_Member_Query $query, $member_type ) {
     
    929944
    930945/**
    931  * Match a set of user ids up to a set of usernames
    932  *
    933  * @since BuddyPress (1.7)
     946 * Get a set of usernames corresponding to a set of user IDs.
     947 *
     948 * @since BuddyPress (1.7.0)
     949 *
     950 * @param array $user_ids Array of user IDs.
     951 * @return array Array of user_logins corresponding to $user_ids.
    934952 */
    935953function bp_groups_admin_get_usernames_from_ids( $user_ids = array() ) {
     
    946964
    947965/**
    948  * AJAX handler for group member autocomplete requests
    949  *
    950  * @since BuddyPress (1.7)
     966 * AJAX handler for group member autocomplete requests.
     967 *
     968 * @since BuddyPress (1.7.0)
    951969 */
    952970function bp_groups_admin_autocomplete_handler() {
     
    9941012 * List table class for the Groups component admin page.
    9951013 *
    996  * @since BuddyPress (1.7)
     1014 * @since BuddyPress (1.7.0)
    9971015 */
    9981016class BP_Groups_List_Table extends WP_List_Table {
    9991017
    10001018    /**
    1001      * What type of view is being displayed? e.g. "All", "Pending", "Approved", "Spam"...
    1002      *
    1003      * @since BuddyPress (1.7)
    1004     */
     1019     * The type of view currently being displayed.
     1020     *
     1021     * e.g. "All", "Pending", "Approved", "Spam"...
     1022     *
     1023     * @since BuddyPress (1.7.0)
     1024     *
     1025     * @access public
     1026     * @var string
     1027     */
    10051028    public $view = 'all';
    10061029
    10071030    /**
    1008      * Group counts for each group type
    1009      *
    1010      * @since BuddyPress (1.7)
     1031     * Group counts for each group type.
     1032     *
     1033     * @since BuddyPress (1.7.0)
     1034     *
     1035     * @access public
     1036     * @var int
    10111037     */
    10121038    public $group_counts = 0;
     
    10151041     * Constructor
    10161042     *
    1017      * @since BuddyPress (1.7)
     1043     * @since BuddyPress (1.7.0)
    10181044     */
    10191045    public function __construct() {
     
    10281054
    10291055    /**
    1030      * Handle filtering of data, sorting, pagination, and any other data-manipulation required prior to rendering.
    1031      *
    1032      * @since BuddyPress (1.7)
     1056     * Set up items for display in the list table.
     1057     *
     1058     * Handles filtering of data, sorting, pagination, and any other data
     1059     * manipulation required prior to rendering.
     1060     *
     1061     * @since BuddyPress (1.7.0)
    10331062     */
    10341063    function prepare_items() {
     
    11331162
    11341163    /**
    1135      * Get an array of all the columns on the page
    1136      *
    1137      * @return array
    1138      * @since BuddyPress (1.7)
     1164     * Get an array of all the columns on the page.
     1165     *
     1166     * @since BuddyPress (1.7.0)
     1167     *
     1168     * @return array Array of column headers.
    11391169     */
    11401170    function get_column_info() {
     
    11491179
    11501180    /**
    1151      * Displays a message on screen when no items are found (e.g. no search matches)
    1152      *
    1153      * @since BuddyPress (1.7)
     1181     * Display a message on screen when no items are found ("No groups found").
     1182     *
     1183     * @since BuddyPress (1.7.0)
    11541184     */
    11551185    function no_items() {
     
    11581188
    11591189    /**
    1160      * Outputs the Groups data table
    1161      *
    1162      * @since BuddyPress (1.7)
     1190     * Output the Groups data table.
     1191     *
     1192     * @since BuddyPress (1.7.0)
    11631193    */
    11641194    function display() {
     
    11901220
    11911221    /**
    1192      * Generates content for a single row of the table
    1193      *
    1194      * @param object $item The current item
    1195      * @since BuddyPress (1.7)
     1222     * Generate content for a single row of the table.
     1223     *
     1224     * @since BuddyPress (1.7.0)
     1225     *
     1226     * @param object $item The current group item in the loop.
    11961227     */
    11971228    function single_row( $item = array() ) {
     
    12191250     * Get the list of views available on this table (e.g. "all", "public").
    12201251     *
    1221      * @since BuddyPress (1.7)
     1252     * @since BuddyPress (1.7.0)
    12221253     */
    12231254    function get_views() {
     
    12361267
    12371268    /**
    1238      * Get bulk actions
    1239      *
    1240      * @return array Key/value pairs for the bulk actions dropdown
    1241      * @since BuddyPress (1.7)
     1269     * Get bulk actions for single group row.
     1270     *
     1271     * @since BuddyPress (1.7.0)
     1272     *
     1273     * @return array Key/value pairs for the bulk actions dropdown.
    12421274     */
    12431275    function get_bulk_actions() {
     
    12501282     * Get the table column titles.
    12511283     *
     1284     * @since BuddyPress (1.7.0)
     1285     *
    12521286     * @see WP_List_Table::single_row_columns()
    1253      * @return array
    1254      * @since BuddyPress (1.7)
     1287     *
     1288     * @return array Array of column titles.
    12551289     */
    12561290    function get_columns() {
     
    12771311     * $desc_first = false.
    12781312     *
    1279      * @return array
    1280      * @since BuddyPress (1.7)
     1313     * @since BuddyPress (1.7.0)
     1314     *
     1315     * @return array Array of sortable column names.
    12811316     */
    12821317    function get_sortable_columns() {
     
    12901325
    12911326    /**
    1292      * Checkbox column
    1293      *
    1294      * @param array $item A singular item (one full row)
     1327     * Markup for the Checkbox column.
     1328     *
     1329     * @since BuddyPress (1.7.0)
     1330     *
    12951331     * @see WP_List_Table::single_row_columns()
    1296      * @since BuddyPress (1.7)
     1332     *
     1333     * @param array $item A singular item (one full row).
    12971334     */
    12981335    function column_cb( $item = array() ) {
     
    13011338
    13021339    /**
    1303      * Group id column
    1304      *
    1305      * @param array $item A singular item (one full row)
     1340     * Markup for the Group ID column.
     1341     *
     1342     * @since BuddyPress (1.7.0)
     1343     *
    13061344     * @see WP_List_Table::single_row_columns()
    1307      * @since BuddyPress (1.7)
     1345     *
     1346     * @param array $item A singular item (one full row).
    13081347     */
    13091348    function column_gid( $item = array() ) {
     
    13161355     * Called "comment" in the CSS so we can re-use some WP core CSS.
    13171356     *
    1318      * @param array $item A singular item (one full row)
     1357     * @since BuddyPress (1.7.0)
     1358     *
    13191359     * @see WP_List_Table::single_row_columns()
    1320      * @since BuddyPress (1.7)
     1360     *
     1361     * @param array $item A singular item (one full row).
    13211362     */
    13221363    function column_comment( $item = array() ) {
     
    13701411
    13711412    /**
    1372      * Description column
    1373      *
    1374      * @since BuddyPress (1.7)
     1413     * Markup for the Description column.
     1414     *
     1415     * @since BuddyPress (1.7.0)
     1416     *
     1417     * @param array Information about the current row.
    13751418     */
    13761419    function column_description( $item = array() ) {
     
    13791422
    13801423    /**
    1381      * Status column
    1382      *
    1383      * @since BuddyPress (1.7)
     1424     * Markup for the Status column.
     1425     *
     1426     * @since BuddyPress (1.7.0)
     1427     *
     1428     * @param array Information about the current row.
    13841429     */
    13851430    function column_status( $item = array() ) {
     
    14051450
    14061451    /**
    1407      * Number of Members column
    1408      *
    1409      * @since BuddyPress (1.7)
     1452     * Markup for the Number of Members column.
     1453     *
     1454     * @since BuddyPress (1.7.0)
     1455     *
     1456     * @param array Information about the current row.
    14101457     */
    14111458    function column_members( $item = array() ) {
     
    14151462
    14161463    /**
    1417      * Last Active column
    1418      *
    1419      * @since BuddyPress (1.7)
     1464     * Markup for the Last Active column.
     1465     *
     1466     * @since BuddyPress (1.7.0)
     1467     *
     1468     * @param array Information about the current row.
    14201469     */
    14211470    function column_last_active( $item = array() ) {
  • trunk/bp-groups/bp-groups-adminbar.php

    r6342 r7561  
    44 * BuddyPress Groups Toolbar
    55 *
    6  * Handles the groups functions related to the WordPress Toolbar
     6 * Handles the groups functions related to the WordPress Toolbar.
    77 *
    88 * @package BuddyPress
     
    1414
    1515/**
    16  * Adds the Group Admin top-level menu to group pages
     16 * Add the Group Admin top-level menu when viewing group pages.
    1717 *
    18  * @package BuddyPress
    19  * @since BuddyPress (1.5)
     18 * @since BuddyPress (1.5.0)
    2019 *
    21  * @todo Add dynamic menu items for group extensions
     20 * @todo Add dynamic menu items for group extensions.
    2221 */
    2322function bp_groups_group_admin_menu() {
     
    107106
    108107/**
    109  * Remove rogue WP core edit menu when viewing a group
     108 * Remove rogue WP core Edit menu when viewing a single group.
    110109 *
    111  * @since BuddyPress (1.6)
     110 * @since BuddyPress (1.6.0)
    112111 */
    113112function bp_groups_remove_edit_page_menu() {
Note: See TracChangeset for help on using the changeset viewer.