Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/05/2025 02:27:53 AM (5 months ago)
Author:
johnjamesjacoby
Message:

Tools - Code Improvement: docs & code formatting improvements.

Props johnjamesjacoby, noruzzaman.

Fixes #3659.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/functions.php

    r7379 r7380  
    22
    33/**
    4  * Main bbPress BuddyPress Class
     4 * Main bbPress BuddyPress Class.
    55 *
    66 * @package bbPress
     
    2424
    2525/**
    26  * Return component name/ID ('forums' by default)
     26 * Return component name/ID ('forums' by default).
    2727 *
    2828 * This is used primarily for Notifications integration.
     
    4444
    4545/**
    46  * Filter the current bbPress user ID with the current BuddyPress user ID
     46 * Filter the current bbPress user ID with the current BuddyPress user ID.
    4747 *
    4848 * @since 2.1.0 bbPress (r3552)
     
    8080
    8181/**
    82  * Filter the bbPress is_single_user function with BuddyPress equivalent
    83  *
    84  * @since 2.1.0 bbPress (r3552)
    85  *
    86  * @param bool $is Optional. Default false
    87  * @return bool True if viewing single user, false if not
     82 * Filter the bbPress is_single_user function with BuddyPress equivalent.
     83 *
     84 * @since 2.1.0 bbPress (r3552)
     85 *
     86 * @param bool $is Optional. Default false.
     87 * @return bool True if viewing single user, false if not.
    8888 */
    8989function bbp_filter_is_single_user( $is = false ) {
     
    9696
    9797/**
    98  * Filter the bbPress is_user_home function with BuddyPress equivalent
    99  *
    100  * @since 2.1.0 bbPress (r3552)
    101  *
    102  * @param bool $is Optional. Default false
    103  * @return bool True if viewing single user, false if not
     98 * Filter the bbPress is_user_home function with BuddyPress equivalent.
     99 *
     100 * @since 2.1.0 bbPress (r3552)
     101 *
     102 * @param bool $is Optional. Default false.
     103 * @return bool True if viewing single user, false if not.
    104104 */
    105105function bbp_filter_is_user_home( $is = false ) {
     
    112112
    113113/**
    114  * Add the topic title to the <title> if viewing a single group forum topic
     114 * Add the topic title to the <title> if viewing a single group forum topic.
    115115 *
    116116 * @since 2.5.0 bbPress (r5161)
    117117 *
    118  * @param string $new_title The title to filter
    119  * @param string $old_title (Not used)
    120  * @param string $sep The separator to use
    121  * @return string The possibly modified title
     118 * @param string $new_title The title to filter.
     119 * @param string $old_title (Not used).
     120 * @param string $sep The separator to u.se
     121 * @return string The possibly modified title.
    122122 */
    123123function bbp_filter_modify_page_title( $new_title = '', $old_title = '', $sep = '' ) {
     
    151151
    152152/**
    153  * Hook bbPress topics template into plugins template
     153 * Hook bbPress topics template into plugins template.
    154154 *
    155155 * @since 2.1.0 bbPress (r3552)
     
    161161
    162162/**
    163  * Hook bbPress replies template into plugins template
     163 * Hook bbPress replies template into plugins template.
    164164 *
    165165 * @since 2.1.0 bbPress (r3552)
     
    171171
    172172/**
    173  * Hook bbPress engagements template into plugins template
     173 * Hook bbPress engagements template into plugins template.
    174174 *
    175175 * @since 2.6.0 bbPress (r6320)
     
    181181
    182182/**
    183  * Hook bbPress favorites template into plugins template
     183 * Hook bbPress favorites template into plugins template.
    184184 *
    185185 * @since 2.1.0 bbPress (r3552)
     
    191191
    192192/**
    193  * Hook bbPress subscriptions template into plugins template
     193 * Hook bbPress subscriptions template into plugins template.
    194194 *
    195195 * @since 2.1.0 bbPress (r3552)
     
    203203
    204204/**
    205  * Get the topics created template part
     205 * Get the topics created template part.
    206206 *
    207207 * @since 2.1.0 bbPress (r3552)
     
    220220
    221221/**
    222  * Get the topics replied to template part
     222 * Get the topics replied to template part.
    223223 *
    224224 * @since 2.1.0 bbPress (r3552)
     
    237237
    238238/**
    239  * Get the topic engagements template part
     239 * Get the topic engagements template part.
    240240 *
    241241 * @since 2.6.0 bbPress (r6320)
     
    254254
    255255/**
    256  * Get the topics favorited template part
     256 * Get the topics favorited template part.
    257257 *
    258258 * @since 2.1.0 bbPress (r3552)
     
    271271
    272272/**
    273  * Get the topics subscribed template part
     273 * Get the topics subscribed template part.
    274274 *
    275275 * @since 2.1.0 bbPress (r3552)
     
    290290
    291291/**
    292  * Clean up the group root setting if the forum is being deleted
     292 * Clean up the group root setting if the forum is being deleted.
    293293 *
    294294 * @since 2.6.0 bbPress (r6479)
    295295 *
    296  * @param int $forum_id The forum ID being deleted
     296 * @param int $forum_id The forum ID being deleted.
    297297 */
    298298function bbp_maybe_delete_group_forum_root( $forum_id = 0 ) {
     
    314314
    315315/**
    316  * Handle the new group forum root creation
     316 * Handle the new group forum root creation.
    317317 *
    318318 * @since 2.6.0 bbPress (r6479)
     
    372372
    373373/**
    374  * Get forum ID's for a group
     374 * Get forum ID's for a group.
    375375 *
    376376 * @since 2.1.0 bbPress (r3653)
    377377 *
    378  * @param int $group_id
     378 * @param int $group_id Group id.
    379379 */
    380380function bbp_get_group_forum_ids( $group_id = 0 ) {
     
    401401
    402402/**
    403  * Get group ID's for a forum
     403 * Get group ID's for a forum.
    404404 *
    405405 * @since 2.1.0 bbPress (r3653)
    406406 *
    407  * @param int $forum_id
     407 * @param int $forum_id Forum id.
    408408 */
    409409function bbp_get_forum_group_ids( $forum_id = 0 ) {
     
    430430
    431431/**
    432  * Get forum ID's for a group
     432 * Get forum ID's for a group.
    433433 *
    434434 * @since 2.1.0 bbPress (r3653)
    435435 *
    436  * @param int $group_id
     436 * @param int $group_id Group id.
    437437 */
    438438function bbp_update_group_forum_ids( $group_id = 0, $forum_ids = array() ) {
     
    451451
    452452/**
    453  * Update group ID's for a forum
     453 * Update group ID's for a forum.
    454454 *
    455455 * @since 2.1.0 bbPress (r3653)
    456456 *
    457  * @param int $forum_id
     457 * @param int $forum_id Forum id.
    458458 */
    459459function bbp_update_forum_group_ids( $forum_id = 0, $group_ids = array() ) {
     
    468468
    469469/**
    470  * Add a group to a forum
     470 * Add a group to a forum.
    471471 *
    472472 * @since 2.1.0 bbPress (r3653)
    473473 *
    474  * @param int $group_id
     474 * @param int $group_id Group id.
    475475 */
    476476function bbp_add_group_id_to_forum( $forum_id = 0, $group_id = 0 ) {
     
    495495
    496496/**
    497  * Remove a forum from a group
     497 * Remove a forum from a group.
    498498 *
    499499 * @since 2.1.0 bbPress (r3653)
    500500 *
    501  * @param int $group_id
     501 * @param int $group_id Group id.
    502502 */
    503503function bbp_add_forum_id_to_group( $group_id = 0, $forum_id = 0 ) {
     
    522522
    523523/**
    524  * Remove a group from a forum
     524 * Remove a group from a forum.
    525525 *
    526526 * @since 2.1.0 bbPress (r3653)
    527527 *
    528  * @param int $group_id
     528 * @param int $group_id Group id.
    529529 */
    530530function bbp_remove_group_id_from_forum( $forum_id = 0, $group_id = 0 ) {
     
    549549
    550550/**
    551  * Remove a forum from a group
     551 * Remove a forum from a group.
    552552 *
    553553 * @since 2.1.0 bbPress (r3653)
    554554 *
    555  * @param int $group_id
     555 * @param int $group_id Group id.
    556556 */
    557557function bbp_remove_forum_id_from_group( $group_id = 0, $forum_id = 0 ) {
     
    576576
    577577/**
    578  * Remove a group from all forums
     578 * Remove a group from all forums.
    579579 *
    580580 * @since 2.1.0 bbPress (r3653)
    581581 *
    582  * @param int $group_id
     582 * @param int $group_id Group id.
    583583 */
    584584function bbp_remove_group_id_from_all_forums( $group_id = 0 ) {
     
    599599
    600600/**
    601  * Remove a forum from all groups
     601 * Remove a forum from all groups.
    602602 *
    603603 * @since 2.1.0 bbPress (r3653)
    604604 *
    605  * @param int $forum_id
     605 * @param int $forum_id Forum id.
    606606 */
    607607function bbp_remove_forum_id_from_all_groups( $forum_id = 0 ) {
     
    618618
    619619/**
    620  * Return true if a forum is a group forum
     620 * Return true if a forum is a group forum.
    621621 *
    622622 * @since 2.3.0 bbPress (r4571)
    623623 *
    624  * @param int $forum_id
    625  * @return bool True if it is a group forum, false if not
     624 * @param int $forum_id Forum id.
     625 * @return bool True if it is a group forum, false if not.
    626626 */
    627627function bbp_is_forum_group_forum( $forum_id = 0 ) {
     
    643643
    644644/**
    645  * Is the current user an admin of the current group
     645 * Is the current user an admin of the current group.
    646646 *
    647647 * @since 2.3.0 bbPress (r4632)
    648648 *
    649  * @return bool If current user is an admin of the current group
     649 * @return bool If current user is an admin of the current group.
    650650 */
    651651function bbp_group_is_admin() {
     
    668668
    669669/**
    670  * Is the current user a moderator of the current group
     670 * Is the current user a moderator of the current group.
    671671 *
    672672 * @since 2.3.0 bbPress (r4632)
    673673 *
    674  * @return bool If current user is a moderator of the current group
     674 * @return bool If current user is a moderator of the current group.
    675675 */
    676676function bbp_group_is_mod() {
     
    693693
    694694/**
    695  * Is the current user a member of the current group
     695 * Is the current user a member of the current group.
    696696 *
    697697 * @since 2.3.0 bbPress (r4632)
    698698 *
    699  * @return bool If current user is a member of the current group
     699 * @return bool If current user is a member of the current group.
    700700 */
    701701function bbp_group_is_member() {
     
    718718
    719719/**
    720  * Is the current user banned from the current group
     720 * Is the current user banned from the current group.
    721721 *
    722722 * @since 2.3.0 bbPress (r4632)
    723723 *
    724  * @return bool If current user is banned from the current group
     724 * @return bool If current user is banned from the current group.
    725725 */
    726726function bbp_group_is_banned() {
     
    743743
    744744/**
    745  * Is the current user the creator of the current group
     745 * Is the current user the creator of the current group.
    746746 *
    747747 * @since 2.3.0 bbPress (r4632)
    748748 *
    749  * @return bool If current user the creator of the current group
     749 * @return bool If current user the creator of the current group.
    750750 */
    751751function bbp_group_is_creator() {
     
    770770
    771771/**
    772  * Return an array of allowed activity actions
     772 * Return an array of allowed activity actions.
    773773 *
    774774 * @since 2.6.0 bbPress (r6370)
     
    866866     * @since 2.6.0 bbPress (r6370)
    867867     *
    868      * @param string               $activity_action Activity action string value
     868     * @param string               $activity_action Activity action string value.
    869869     * @param string               $type            The type of post. Expects `topic` or `reply`.
    870870     * @param string               $action          The current action string.
     
    879879 * @since 2.6.0 bbPress (r6370)
    880880 *
    881  * @param string $action   The current action string
    882  * @param object $activity The BuddyPress activity object
     881 * @param string $action   The current action string.
     882 * @param object $activity The BuddyPress activity object.
    883883 *
    884884 * @return string The formatted activity action.
     
    903903 * @since 2.6.0 bbPress (r6370)
    904904 *
    905  * @param string $action   The current action string
    906  * @param object $activity The BuddyPress activity object
     905 * @param string $action   The current action string.
     906 * @param object $activity The BuddyPress activity object.
    907907 *
    908908 * @return string The formatted activity action
Note: See TracChangeset for help on using the changeset viewer.