Skip to:
Content

BuddyPress.org

Changeset 9026


Ignore:
Timestamp:
09/17/2014 12:39:27 AM (10 years ago)
Author:
boonebgorges
Message:

Improved inline documentation in bp-groups

See #5022

Location:
trunk/src/bp-groups
Files:
7 edited

Legend:

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

    r9023 r9026  
    317317add_action( 'bp_actions', 'groups_action_create_group' );
    318318
     319/**
     320 * Catch and process "Join Group" button clicks.
     321 */
    319322function groups_action_join_group() {
    320323    global $bp;
     
    402405/**
    403406 * Sort the group creation steps.
     407 *
     408 * @return bool|null False on failure.
    404409 */
    405410function groups_action_sort_creation_steps() {
     
    444449 *
    445450 * @since BuddyPress (1.2.0)
     451 *
     452 * @return bool|null False on failure.
    446453 */
    447454function groups_action_group_feed() {
  • trunk/src/bp-groups/bp-groups-activity.php

    r8832 r9026  
    1616/**
    1717 * Register activity actions for the Groups component.
     18 *
     19 * @return bool|null False on failure.
    1820 */
    1921function groups_register_activity_actions() {
     
    240242 * @param int $group_id Optional. The ID of the group whose last_activity is
    241243 *        being updated. Default: the current group's ID.
     244 * @return bool|null False on failure.
    242245 */
    243246function groups_update_last_activity( $group_id = 0 ) {
     
    262265 *
    263266 * @since BuddyPress (1.9.0)
    264  * @param int $user_id
    265  * @param int $group_id
     267 *
     268 * @param int $user_id ID of the user joining the group.
     269 * @param int $group_id ID of the group.
     270 * @return bool|null False on failure.
    266271 */
    267272function bp_groups_membership_accepted_add_activity( $user_id, $group_id ) {
     
    286291
    287292/**
    288  * Delete all group activity from activity streams
     293 * Delete all activity items related to a specific group.
    289294 *
    290295 * @since BuddyPress (1.9.0)
     296 *
     297 * @param int $group_id ID of the group.
    291298 */
    292299function bp_groups_delete_group_delete_all_activity( $group_id ) {
     
    301308
    302309/**
    303  * Delete group member activity if they leave or are removed within 5 minutes of
    304  * membership modification.
     310 * Delete group member activity if they leave or are removed within 5 minutes of membership modification.
    305311 *
    306312 * If the user joined this group less than five minutes ago, remove the
     
    309315 *
    310316 * @since BuddyPress (1.9.0)
     317 *
     318 * @param int $group_id ID of the group.
     319 * @param int $user_id ID of the user leaving the group.
    311320 */
    312321function bp_groups_leave_group_delete_recent_activity( $group_id, $user_id ) {
  • trunk/src/bp-groups/bp-groups-admin.php

    r8958 r9026  
    6969 * @since BuddyPress (1.7.0)
    7070 *
    71  * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table
     71 * @global BP_Groups_List_Table $bp_groups_list_table Groups screen list table.
    7272 */
    7373function bp_groups_admin_load() {
     
    10391039     *
    10401040     * @since BuddyPress (1.7.0)
    1041      *
    10421041     * @access public
    10431042     * @var string
     
    10491048     *
    10501049     * @since BuddyPress (1.7.0)
    1051      *
    10521050     * @access public
    10531051     * @var int
  • trunk/src/bp-groups/bp-groups-adminbar.php

    r8737 r9026  
    1919 *
    2020 * @todo Add dynamic menu items for group extensions.
     21 *
     22 * @return bool|null False if not on a group page, or if user does not have
     23 *        access to group admin options.
    2124 */
    2225function bp_groups_group_admin_menu() {
  • trunk/src/bp-groups/bp-groups-classes.php

    r8950 r9026  
    159159     * @param int $id Optional. If the ID of an existing group is provided,
    160160     *        the object will be pre-populated with info about that group.
     161     * @param array $args {
     162     *     Array of optional arguments.
     163     *     @type bool $populate_extras Whether to fetch "extra" data about
     164     *           the group (group admins/mods, access for the current user).
     165     *           Default: false.
     166     * }
    161167     */
    162168    public function __construct( $id = null, $args = array() ) {
     
    14921498     *
    14931499     * @since BuddyPress (1.8.1)
     1500     * @access protected
    14941501     * @var null|array Null if not yet defined, otherwise an array of ints.
    14951502     */
     
    17381745     * @since BuddyPress (1.8.0)
    17391746     *
    1740      * @param object $query BP_User_Query object. Because we're filtering
    1741      *   the current object, we use $this inside of the method instead
     1747     * @param BP_User_Query $query BP_User_Query object. Because we're
     1748     *        filtering the current object, we use $this inside of the
     1749     *        method instead.
    17421750     * @param string $user_ids_sql Sanitized, comma-separated string of
    1743      *   the user ids returned by the main query
     1751     *        the user ids returned by the main query.
    17441752     */
    17451753    public function populate_group_member_extras( $query, $user_ids_sql ) {
     
    17731781     * Sort user IDs by how recently they have generated activity within a given group.
    17741782     *
    1775      * @since  BuddyPress (2.1.0)
     1783     * @since BuddyPress (2.1.0)
    17761784     *
    17771785     * @param BP_User_Query $query BP_User_Query object.
     
    18151823
    18161824/**
    1817  * BuddyPress Group Membership objects.
     1825 * BuddyPress Group Membership object.
    18181826 */
    18191827class BP_Groups_Member {
     
    28412849     *
    28422850     * @since BuddyPress (1.8.0)
     2851     * @access public
    28432852     * @var array
    28442853     */
     
    28492858     *
    28502859     * @since BuddyPress (1.8.0)
     2860     * @access public
    28512861     * @var string
    28522862     */
     
    28572867     *
    28582868     * @since BuddyPress (1.8.0)
     2869     * @access public
    28592870     * @var ReflectionClass
    28602871     */
     
    28652876     *
    28662877     * @since BuddyPress (1.8.0)
     2878     * @access public
    28672879     * @var array
    28682880     */
     
    28732885     *
    28742886     * @since BuddyPress (2.1.0)
     2887     * @access public
    28752888     * @var array
    28762889     */
     
    28812894     *
    28822895     * @since BuddyPress (1.8.0)
     2896     * @access public
    28832897     * @var int
    28842898     */
     
    28882902     * The slug of the current extension.
    28892903     *
     2904     * @access public
    28902905     * @var string
    28912906     */
     
    28952910     * The translatable name of the current extension.
    28962911     *
     2912     * @access public
    28972913     * @var string
    28982914     */
     
    29022918     * The visibility of the extension tab. 'public' or 'private'.
    29032919     *
     2920     * @access public
    29042921     * @var string
    29052922     */
     
    29092926     * The numeric position of the main nav item.
    29102927     *
     2928     * @access public
    29112929     * @var int
    29122930     */
     
    29162934     * Whether to show the nav item.
    29172935     *
     2936     * @access public
    29182937     * @var bool
    29192938     */
     
    29242943     *
    29252944     * @since BuddyPress (2.1.0)
     2945     * @access public
    29262946     * @var bool
    29272947     */
     
    29322952     *
    29332953     * @since BuddyPress (2.1.0)
     2954     * @access public
    29342955     * @var bool
    29352956     */
     
    29392960     * The text of the nav item. Defaults to self::name.
    29402961     *
     2962     * @access public
    29412963     * @var string
    29422964     */
     
    29482970     * Default: 'groups_custom_group_boxes'.
    29492971     *
     2972     * @access public
    29502973     * @var string
    29512974     */
     
    29572980     * Default: 'groups/single/plugins'.
    29582981     *
     2982     * @access public
    29592983     * @var string
    29602984     */
     
    29672991     *
    29682992     * @since BuddyPress (1.8.0)
     2993     * @access protected
    29692994     * @var bool
    29702995     */
     
    29753000     *
    29763001     * @since BuddyPress (1.8.0)
     3002     * @access protected
    29773003     * @var array
    29783004     */
     
    29863012     *
    29873013     * @since BuddyPress (1.8.0)
     3014     * @access protected
    29883015     * @var array
    29893016     */
     
    29943021     *
    29953022     * @since BuddyPress (2.1.0)
     3023     * @access protected
    29963024     * @var string
    29973025     */
     
    30023030     *
    30033031     * @since BuddyPress (1.8.0)
     3032     * @access protected
    30043033     * @var array
    30053034     */
     
    31913220     *
    31923221     * @since BuddyPress (1.8.0)
     3222     *
     3223     * @return int
    31933224     */
    31943225    public static function get_group_id() {
     
    32223253     *
    32233254     * @since BuddyPress (1.8.0)
     3255     *
     3256     * @return array
    32243257     */
    32253258    protected function get_default_screens() {
     
    38593892     * @since BuddyPress (1.8.0)
    38603893     *
    3861      * @uses wp_nonce_field()
    3862      *
    38633894     * @param string $context Screen context. 'create', 'edit', or 'admin'.
    38643895     */
     
    38713902     *
    38723903     * @since BuddyPress (1.8.0)
    3873      *
    3874      * @uses check_admin_referer()
    38753904     *
    38763905     * @param string $context Screen context. 'create', 'edit', or 'admin'.
     
    38903919     *
    38913920     * @param string $context Screen context. 'create', 'edit', or 'admin'.
    3892      *
    38933921     * @return bool True if the screen is enabled, otherwise false.
    38943922     */
     
    43614389     *
    43624390     * @since BuddyPress (2.1.0)
     4391     * @access protected
    43634392     * @var array $args {
    43644393     *     @type int $group_id Positive integers will restrict the search to members in that group.
  • trunk/src/bp-groups/bp-groups-filters.php

    r8458 r9026  
    111111}
    112112
    113 /** Group forums **************************************************************/
    114 
    115 /**
    116  * Only filter the forum SQL on group pages or on the forums directory
     113/** Legacy group forums (bbPress 1.x) *****************************************/
     114
     115/**
     116 * Filter bbPress query SQL when on group pages or on forums directory.
    117117 */
    118118function groups_add_forum_privacy_sql() {
     
    123123add_filter( 'bbpress_init', 'groups_add_forum_privacy_sql' );
    124124
     125/**
     126 * Add fields to bbPress query for group-specific data.
     127 *
     128 * @param string $sql
     129 * @return string
     130 */
    125131function groups_add_forum_fields_sql( $sql = '' ) {
    126132    $sql = 't.*, g.id as object_id, g.name as object_name, g.slug as object_slug';
     
    128134}
    129135
     136/**
     137 * Add JOINed tables to bbPress query for group-specific data.
     138 *
     139 * @param string $sql
     140 * @return string
     141 */
    130142function groups_add_forum_tables_sql( $sql = '' ) {
    131143    global $bp;
     
    136148}
    137149
     150/**
     151 * Add WHERE clauses to bbPress query for group-specific data and access protection.
     152 *
     153 * @param string $sql
     154 * @return string
     155 */
    138156function groups_add_forum_where_sql( $sql = '' ) {
    139157    global $bp;
     
    179197}
    180198
     199/**
     200 * Modify bbPress caps for bp-forums.
     201 *
     202 * @param bool $value
     203 * @param string $cap
     204 * @param array $args
     205 * @return bool
     206 */
    181207function groups_filter_bbpress_caps( $value, $cap, $args ) {
    182208    global $bp;
     
    196222
    197223/**
    198  * Amends the forum directory's "last active" bbPress SQL query to stop it fetching
    199  * information we aren't going to use. This speeds up the query.
     224 * Amends the forum directory's "last active" bbPress SQL query to stop it fetching information we aren't going to use.
     225 *
     226 * This speeds up the query.
     227 *
     228 * @since BuddyPress (1.5.0)
    200229 *
    201230 * @see BB_Query::_filter_sql()
    202  * @since BuddyPress (1.5)
    203231 */
    204232function groups_filter_forums_root_page_sql( $sql ) {
  • trunk/src/bp-groups/bp-groups-forums.php

    r8460 r9026  
    2323 * Uses the bundled version of bbPress packaged with BuddyPress.
    2424 *
    25  * @param int $group_id The group ID that the new forum should be attached to
    26  * @param string $group_name The group name
    27  * @param string $group_desc The group description
    28  *
    29  * @since BuddyPress (1.0)
     25 * @since BuddyPress (1.0.0)
     26 *
     27 * @param int $group_id The group ID that the new forum should be attached to.
     28 * @param string $group_name The group name.
     29 * @param string $group_desc The group description.
    3030 */
    3131function groups_new_group_forum( $group_id = 0, $group_name = '', $group_desc = '' ) {
     
    5454
    5555/**
    56  * Updates group forum metadata (title, description, slug) when the group's details are edited
    57  *
    58  * @package BuddyPress
    59  * @subpackage Groups
    60  *
    61  * @param int $group_id Group id, passed from groups_details_updated
    62  *
    63  * @since BuddyPress (1.1)
     56 * Update group forum metadata (title, description, slug) when the group's details are edited.
     57 *
     58 * @since BuddyPress (1.1.0)
     59 *
     60 * @param int $group_id Group id, passed from groups_details_updated.
    6461 */
    6562function groups_update_group_forum( $group_id ) {
     
    8885
    8986/**
    90  * Creates a new group forum post.
    91  *
    92  * Uses the bundled version of bbPress packaged with BuddyPress.
    93  *
    94  * @param string $post_text The text for the forum post
    95  * @param int $topic_id The topic ID used so we can identify where the new forum post should reside
    96  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
     87 * Create a new group forum post.
     88 *
     89 * Uses the bundled version of bbPress packaged with BuddyPress.
     90 *
     91 * @since BuddyPress (1.0.0)
     92 *
     93 * @param string $post_text The text for the forum post.
     94 * @param int $topic_id The topic ID used so we can identify where the new
     95 *        forum post should reside.
     96 * @param mixed $page The page number where the new forum post should reside.
     97 *        Default: false.
    9798 * @return mixed The new forum post ID on success. Boolean false on failure.
    98  *
    99  * @since BuddyPress (1.0)
    10099 */
    101100function groups_new_group_forum_post( $post_text, $topic_id, $page = false ) {
     
    140139
    141140/**
    142  * Creates a new group forum topic.
    143  *
    144  * Uses the bundled version of bbPress packaged with BuddyPress.
    145  *
    146  * @param string $topic_title The title for the forum topic
    147  * @param string $topic_text The text for the forum topic
    148  * @param string $topic_tags A comma-delimited string of topic tags
    149  * @param int $forum_id The forum ID this forum topic resides in
     141 * Create a new group forum topic.
     142 *
     143 * Uses the bundled version of bbPress packaged with BuddyPress.
     144 *
     145 * @since BuddyPress (1.0.0)
     146 *
     147 * @param string $topic_title The title for the forum topic.
     148 * @param string $topic_text The text for the forum topic.
     149 * @param string $topic_tags A comma-delimited string of topic tags.
     150 * @param int $forum_id The forum ID this forum topic resides in.
    150151 * @return mixed The new topic object on success. Boolean false on failure.
    151  *
    152  * @since BuddyPress (1.0)
    153152 */
    154153function groups_new_group_forum_topic( $topic_title, $topic_text, $topic_tags, $forum_id ) {
     
    191190
    192191/**
    193  * Updates an existing group forum topic.
    194  *
    195  * Uses the bundled version of bbPress packaged with BuddyPress.
    196  *
    197  * @param int $topic_id The topic ID of the existing forum topic
    198  * @param string $topic_title The title for the forum topic
    199  * @param string $topic_text The text for the forum topic
    200  * @param mixed $topic_tags A comma-delimited string of topic tags. Defaults to boolean false.
     192 * Update an existing group forum topic.
     193 *
     194 * Uses the bundled version of bbPress packaged with BuddyPress.
     195 *
     196 * @since BuddyPress (1.1.0)
     197 *
     198 * @param int $topic_id The topic ID of the existing forum topic.
     199 * @param string $topic_title The title for the forum topic.
     200 * @param string $topic_text The text for the forum topic.
     201 * @param mixed $topic_tags A comma-delimited string of topic tags. Optional.
    201202 * @return mixed The topic object on success. Boolean false on failure.
    202  *
    203  * @since BuddyPress (1.1)
    204203 */
    205204function groups_update_group_forum_topic( $topic_id, $topic_title, $topic_text, $topic_tags = false ) {
     
    251250
    252251/**
    253  * Updates an existing group forum post.
    254  *
    255  * Uses the bundled version of bbPress packaged with BuddyPress.
    256  *
    257  * @param int $post_id The post ID of the existing forum post
    258  * @param string $post_text The text for the forum post
    259  * @param int $topic_id The topic ID of the existing forum topic
    260  * @param mixed $page The page number where the new forum post should reside. Defaults to boolean false.
     252 * Update an existing group forum post.
     253 *
     254 * Uses the bundled version of bbPress packaged with BuddyPress.
     255 *
     256 * @since BuddyPress (1.1.0)
     257 *
     258 * @param int $post_id The post ID of the existing forum post.
     259 * @param string $post_text The text for the forum post.
     260 * @param int $topic_id The topic ID of the existing forum topic.
     261 * @param mixed $page The page number where the new forum post should reside.
     262 *    Optional.
    261263 * @return mixed The forum post ID on success. Boolean false on failure.
    262  *
    263  * @since BuddyPress (1.1)
    264264 */
    265265function groups_update_group_forum_post( $post_id, $post_text, $topic_id, $page = false ) {
     
    320320
    321321/**
    322  * Deletes a group forum topic and also any corresponding activity items.
    323  *
    324  * Uses the bundled version of bbPress packaged with BuddyPress.
    325  *
    326  * @package BuddyPress
    327  *
    328  * @uses bp_activity_delete() to delete corresponding activity items
    329  * @uses bp_forums_get_topic_posts() to get the child posts
    330  * @uses bp_forums_delete_topic() to do the deletion itself
    331  * @param int $topic_id The id of the topic to be deleted
    332  * @return bool True if the delete routine went through properly
    333  *
    334  * @since BuddyPress (1.1)
     322 * Delete a group forum topic and also any corresponding activity items.
     323 *
     324 * Uses the bundled version of bbPress packaged with BuddyPress.
     325 *
     326 * @since BuddyPress (1.1.0)
     327 *
     328 * @param int $topic_id The ID of the topic to be deleted.
     329 * @return bool True if the delete routine went through properly.
    335330 */
    336331function groups_delete_group_forum_topic( $topic_id ) {
     
    373368
    374369/**
    375  * Deletes a group forum post and its corresponding activity item.
    376  *
    377  * Uses the bundled version of bbPress packaged with BuddyPress.
    378  *
    379  * @package BuddyPress
    380  *
    381  * @param int $post_id The id of the post you want to delete
     370 * Delete a group forum post and its corresponding activity item.
     371 *
     372 * Uses the bundled version of bbPress packaged with BuddyPress.
     373 *
     374 * @since BuddyPress (1.1.0)
     375 *
     376 * @param int $post_id The ID of the post you want to delete.
    382377 * @param int $topic_id Optional. The topic to which the post belongs. This
    383  *                      value isn't used in the function but is passed along to
    384  *                      do_action() hooks.
     378 *        value isn't used in the function but is passed along to do_action()
     379 *        hooks.
    385380 * @return bool True on success.
    386  *
    387  * @since BuddyPress (1.1)
    388381 */
    389382function groups_delete_group_forum_post( $post_id, $topic_id = false ) {
     
    411404
    412405/**
    413  * Get a total count of all public topics of a given type, across groups/forums
    414  *
    415  * @package BuddyPress
    416  * @since BuddyPress (1.5)
    417  *
    418  * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.  Defaults to 'newest'.
    419  * @return int The topic count
     406 * Get a total count of all public topics of a given type, across groups/forums.
     407 *
     408 * @since BuddyPress (1.5.0)
     409 *
     410 * @param string $type Either 'newest', 'popular', 'unreplied', 'tags'.
     411 *        Default: 'newest'.
     412 * @return int The topic count.
    420413 */
    421414function groups_total_public_forum_topic_count( $type = 'newest' ) {
     
    424417
    425418/**
    426  * Get a total count of all topics of a given status, across groups/forums
    427  *
    428  * @package BuddyPress
    429  * @since BuddyPress (1.5)
    430  *
    431  * @param string $status 'public', 'private', 'hidden', 'all' Which group types to count
    432  * @return int The topic count
     419 * Get a total count of all topics of a given status, across groups/forums.
     420 *
     421 * @since BuddyPress (1.5.0)
     422 *
     423 * @param string $status Which groups to count. 'public', 'private', 'hidden',
     424 *        'all'. Default: 'public'.
     425 * @param string $search_terms Optional. Limit by a search term.
     426 * @return int The topic count.
    433427 */
    434428function groups_total_forum_topic_count( $status = 'public', $search_terms = false ) {
Note: See TracChangeset for help on using the changeset viewer.