Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/05/2025 02:27:53 AM (6 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/groups.php

    r7379 r7380  
    22
    33/**
    4  * bbPress BuddyPress Group Extension Class
     4 * bbPress BuddyPress Group Extension Class.
    55 *
    66 * This file is responsible for connecting bbPress to the BuddyPress Groups
     
    1717if ( ! class_exists( 'BBP_Forums_Group_Extension' ) && class_exists( 'BP_Group_Extension' ) ) :
    1818/**
    19  * Loads Group Extension for Forums Component
     19 * Loads Group Extension for Forums Component.
    2020 *
    2121 * @since 2.1.0 bbPress (r3552)
     
    2929
    3030    /**
    31      * Setup bbPress group extension variables
     31     * Setup bbPress group extension variables.
    3232     *
    3333     * @since 2.1.0 bbPress (r3552)
     
    4242
    4343    /**
    44      * Setup the group forums class variables
     44     * Setup the group forums class variables.
    4545     *
    4646     * @since 2.1.0 bbPress (r3552)
     
    7575
    7676    /**
    77      * Setup the group forums class actions
     77     * Setup the group forums class actions.
    7878     *
    7979     * @since 2.3.0 bbPress (r4552)
     
    108108
    109109    /**
    110      * Setup the group forums class filters
     110     * Setup the group forums class filters.
    111111     *
    112112     * @since 2.3.0 bbPress (r4552)
     
    210210
    211211    /**
    212      * The primary display function for group forums
     212     * The primary display function for group forums.
    213213     *
    214214     * @since 2.1.0 bbPress (r3746)
     
    235235
    236236    /**
    237      * Maybe unset the group forum nav item if group does not have a forum
     237     * Maybe unset the group forum nav item if group does not have a forum.
    238238     *
    239239     * @since 2.3.0 bbPress (r4552)
    240240     *
    241      * @return If not viewing a single group
     241     * @return If not viewing a single group.
    242242     */
    243243    public function maybe_unset_forum_menu() {
     
    339339     * @since 2.6.14
    340340     *
    341      * @param int $topic_id
     341     * @param int $topic_id Topic id.
    342342     */
    343343    public function validate_topic_forum_id( $topic_id = 0 ) {
     
    400400     * @since 2.6.14
    401401     *
    402      * @param int $reply_id
     402     * @param int $reply_id Reply id.
    403403     */
    404404    public function validate_reply_to_id( $reply_id = 0 ) {
     
    456456
    457457    /**
    458      * Show forums and new forum form when editing a group
     458     * Show forums and new forum form when editing a group.
    459459     *
    460460     * @since 2.1.0 bbPress (r3563)
     
    522522
    523523    /**
    524      * Save the Group Forum data on edit
     524     * Save the Group Forum data on edit.
    525525     *
    526526     * @since 2.0.0 bbPress (r3465)
    527527     *
    528      * @param int $group_id (to handle Group Admin UI hook bp_group_admin_edit_after )
     528     * @param int $group_id (to handle Group Admin UI hook bp_group_admin_edit_after).
    529529     */
    530530    public function edit_screen_save( $group_id = 0 ) {
     
    633633
    634634    /**
    635      * Adds a meta-box to BuddyPress Group Admin UI
     635     * Adds a meta-box to BuddyPress Group Admin UI.
    636636     *
    637637     * @since 2.3.0 bbPress (r4814)
     
    649649
    650650    /**
    651      * Displays the bbPress meta-box in BuddyPress Group Admin UI
     651     * Displays the bbPress meta-box in BuddyPress Group Admin UI.
    652652     *
    653653     * @since 2.3.0 bbPress (r4814)
    654654     *
    655      * @param object $item (group object)
     655     * @param object $item (group object).
    656656     */
    657657    public function group_admin_ui_display_metabox( $item ) {
     
    662662
    663663    /**
    664      * Show forums and new forum form when creating a group
     664     * Show forums and new forum form when creating a group.
    665665     *
    666666     * @since 2.0.0 bbPress (r3465)
     
    692692
    693693    /**
    694      * Save the Group Forum data on create
     694     * Save the Group Forum data on create.
    695695     *
    696696     * @since 2.0.0 bbPress (r3465)
     
    781781
    782782    /**
    783      * Used to start an output buffer
     783     * Used to start an output buffer.
    784784     *
    785785     * @since 2.1.0 bbPress (r3746)
     
    790790
    791791    /**
    792      * Used to end an output buffer
     792     * Used to end an output buffer.
    793793     *
    794794     * @since 2.1.0 bbPress (r3746)
     
    799799
    800800    /**
    801      * Creating a group forum or category (including root for group)
     801     * Creating a group forum or category (including root for group).
    802802     *
    803803     * @since 2.1.0 bbPress (r3653)
     
    805805     * @param array $forum_args
    806806     *
    807      * @return void if no forum_id is available
     807     * @return void if no forum_id is available.
    808808     */
    809809    public function new_forum( $forum_args = array() ) {
     
    825825
    826826    /**
    827      * Removing a group forum or category (including root for group)
     827     * Removing a group forum or category (including root for group).
    828828     *
    829829     * @since 2.1.0 bbPress (r3653)
     
    831831     * @param array $forum_args
    832832     *
    833      * @return void if no forum_id is available
     833     * @return void if no forum_id is available.
    834834     */
    835835    public function remove_forum( $forum_args = array() ) {
     
    851851
    852852    /**
    853      * Listening to BuddyPress Group deletion to remove the forum
     853     * Listening to BuddyPress Group deletion to remove the forum.
    854854     *
    855855     * @since 2.3.0 bbPress (r4815)
    856856     *
    857      * @param int $group_id The group ID
     857     * @param int $group_id The group ID.
    858858     */
    859859    public function disconnect_forum_from_group( $group_id = 0 ) {
     
    888888     * Update forum attributes to match those of the associated group.
    889889     *
    890      * Fired whenever a group is saved
     890     * Fired whenever a group is saved.
    891891     *
    892892     * @since 2.6.7 bbPress (r7208)
     
    968968
    969969    /**
    970      * Toggle the enable_forum group setting on or off
     970     * Toggle the enable_forum group setting on or off.
    971971     *
    972972     * @since 2.3.0 bbPress (r4612)
    973973     *
    974      * @param int $group_id The group to toggle
    975      * @param bool $enabled True for on, false for off
    976      * @return False if group is not found, otherwise return the group
     974     * @param int $group_id The group to toggle.
     975     * @param bool $enabled True for on, false for off.
     976     * @return False if group is not found, otherwise return the group.
    977977     */
    978978    public function toggle_group_forum( $group_id = 0, $enabled = false ) {
     
    10071007
    10081008    /**
    1009      * Output the forums for a group in the edit screens
     1009     * Output the forums for a group in the edit screens.
    10101010     *
    10111011     * As of right now, bbPress only supports 1-to-1 group forum relationships.
     
    12411241
    12421242    /**
    1243      * Strip super stickies from the topic query
     1243     * Strip super stickies from the topic query.
    12441244     *
    12451245     * @since 2.3.0 bbPress (r4810)
    12461246     *
    12471247     * @access private
    1248      * @param array $super the super sticky post ID's
     1248     * @param array $super the super sticky post ID's.
    12491249     * @return array (empty)
    12501250     */
     
    12551255
    12561256    /**
    1257      * Unset the type super sticky from topic type
     1257     * Unset the type super sticky from topic type.
    12581258     *
    12591259     * @since 2.3.0 bbPress (r4810)
     
    12611261     * @access private
    12621262     * @param array $args
    1263      * @return array $args without the to-front link
     1263     * @return array $args without the to-front link.
    12641264     */
    12651265    public function unset_super_sticky( $args = array() ) {
     
    12711271
    12721272    /**
    1273      * Ugly preg_replace to hide the to front admin link
     1273     * Ugly preg_replace to hide the to front admin link.
    12741274     *
    12751275     * @since 2.3.0 bbPress (r4810)
     
    12781278     * @param string $retval
    12791279     * @param array $args
    1280      * @return string $retval without the to-front link
     1280     * @return string $retval without the to-front link.
    12811281     */
    12821282    public function hide_super_sticky_admin_link( $retval = '', $args = array() ) {
     
    12911291
    12921292    /**
    1293      * Redirect to the group forum screen
     1293     * Redirect to the group forum screen.
    12941294     *
    12951295     * @since 2.1.0 bbPress (r3653)
     
    13091309
    13101310    /**
    1311      * Redirect to the group forum screen
     1311     * Redirect to the group forum screen.
    13121312     *
    13131313     * @since 2.1.0 bbPress (r3653)
     
    13421342
    13431343    /**
    1344      * Redirect to the group admin forum edit screen
     1344     * Redirect to the group admin forum edit screen.
    13451345     *
    13461346     * @since 2.1.0 bbPress (r3653)
     
    15291529
    15301530    /**
    1531      * Maybe map a bbPress forum/topic/reply permalink to the corresponding group
     1531     * Maybe map a bbPress forum/topic/reply permalink to the corresponding group.
    15321532     *
    15331533     * @since 2.2.0 bbPress (r4266)
    15341534     *
    15351535     * @param int $post_id
    1536      * @return Bail early if not a group forum post
     1536     * @return Bail early if not a group forum post.
    15371537     * @return string
    15381538     */
     
    15851585
    15861586    /**
    1587      * Map a forum permalink to its corresponding group
     1587     * Map a forum permalink to its corresponding group.
    15881588     *
    15891589     * @since 2.1.0 bbPress (r3802)
     
    15981598
    15991599    /**
    1600      * Map a topic permalink to its group forum
     1600     * Map a topic permalink to its group forum.
    16011601     *
    16021602     * @since 2.1.0 bbPress (r3802)
     
    16111611
    16121612    /**
    1613      * Map a reply permalink to its group forum
     1613     * Map a reply permalink to its group forum.
    16141614     *
    16151615     * @since 2.1.0 bbPress (r3802)
     
    16241624
    16251625    /**
    1626      * Map a reply edit link to its group forum
     1626     * Map a reply edit link to its group forum.
    16271627     *
    16281628     * @since 2.2.0 bbPress (r4266)
     
    16431643
    16441644    /**
    1645      * Map a post link to its group forum
     1645     * Map a post link to its group forum.
    16461646     *
    16471647     * @since 2.2.0 bbPress (r4266)
     
    16571657
    16581658    /**
    1659      * Map a page link to its group forum
     1659     * Map a page link to its group forum.
    16601660     *
    16611661     * @since 2.2.0 bbPress (r4266)
     
    16711671
    16721672    /**
    1673      * Map a custom post type link to its group forum
     1673     * Map a custom post type link to its group forum.
    16741674     *
    16751675     * @since 2.2.0 bbPress (r4266)
     
    16861686
    16871687    /**
    1688      * Fix pagination of topics on forum view
     1688     * Fix pagination of topics on forum view.
    16891689     *
    16901690     * @since 2.2.0 bbPress (r4266)
     
    17061706
    17071707    /**
    1708      * Fix pagination of replies on topic view
     1708     * Fix pagination of replies on topic view.
    17091709     *
    17101710     * @since 2.2.0 bbPress (r4266)
     
    17321732     * @since 2.6.14
    17331733     *
    1734      * @param  object $query  Verified query object
    1735      * @param  string $type   Type of variable to compare to
    1736      * @return mixed  Verified object if valid, Default or null if invalid
     1734     * @param  object $query  Verified query object.
     1735     * @param  string $type   Type of variable to compare to.
     1736     * @return mixed  Verified object if valid, Default or null if invalid.
    17371737     */
    17381738    public function rewrite_pagination( $query, $type = '' ) {
Note: See TracChangeset for help on using the changeset viewer.