Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
10/04/2015 07:29:24 AM (11 years ago)
Author:
tw2113
Message:

Initial documentation cleanup for the BP Forums Component.

See #6397.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-forums/bp-forums-loader.php

    r10096 r10183  
    11<?php
    22/**
    3  * BuddyPress Forums Loader
     3 * BuddyPress Forums Loader.
    44 *
    55 * A discussion forums component. Comes bundled with bbPress stand-alone.
     
    4848                $bp = buddypress();
    4949
    50                 // Define the parent forum ID
     50                // Define the parent forum ID.
    5151                if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) {
    5252                        define( 'BP_FORUMS_PARENT_FORUM_ID', 1 );
    5353                }
    5454
    55                 // Define a slug, if necessary
     55                // Define a slug, if necessary.
    5656                if ( ! defined( 'BP_FORUMS_SLUG' ) ) {
    5757                        define( 'BP_FORUMS_SLUG', $this->id );
    5858                }
    5959
    60                 // The location of the bbPress stand-alone config file
     60                // The location of the bbPress stand-alone config file.
    6161                $bbconfig = bp_core_get_root_option( 'bb-config-location' );
    6262                if ( '' !== $bbconfig ) {
     
    8686        public function includes( $includes = array() ) {
    8787
    88                 // Files to include
     88                // Files to include.
    8989                $includes = array(
    9090                        'actions',
     
    9696                );
    9797
    98                 // bbPress stand-alone
     98                // bbPress stand-alone.
    9999                if ( ! defined( 'BB_PATH' ) ) {
    100100                        $includes[] = 'bbpress-sa';
    101101                }
    102102
    103                 // Admin-specific code
     103                // Admin-specific code.
    104104                if ( is_admin() ) {
    105105                        $includes[] = 'deprecated/1.6';
     
    118118         *
    119119         * @param array $main_nav Optional. See BP_Component::setup_nav() for
    120          *        description.
    121          * @param array $sub_nav Optional. See BP_Component::setup_nav() for
    122          *        description.
     120         *                        description.
     121         * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
     122         *                        description.
    123123         */
    124124        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
    125125
    126                 // Stop if forums haven't been set up yet
     126                // Stop if forums haven't been set up yet.
    127127                if ( ! bp_forums_is_installed_correctly() ) {
    128128                        return;
    129129                }
    130130
    131                 // Stop if there is no user displayed or logged in
     131                // Stop if there is no user displayed or logged in.
    132132                if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) {
    133133                        return;
    134134                }
    135135
    136                 // Determine user to use
     136                // Determine user to use.
    137137                if ( bp_displayed_user_domain() ) {
    138138                        $user_domain = bp_displayed_user_domain();
     
    143143                }
    144144
    145                 // User link
     145                // User link.
    146146                $slug        = bp_get_forums_slug();
    147147                $forums_link = trailingslashit( $user_domain . $slug );
    148148
    149                 // Add 'Forums' to the main navigation
     149                // Add 'Forums' to the main navigation.
    150150                $main_nav = array(
    151151                        'name'                => __( 'Forums', 'buddypress' ),
     
    157157                );
    158158
    159                 // Topics started
     159                // Topics started.
    160160                $sub_nav[] = array(
    161161                        'name'            => __( 'Topics Started', 'buddypress' ),
     
    168168                );
    169169
    170                 // Topics replied to
     170                // Topics replied to.
    171171                $sub_nav[] = array(
    172172                        'name'            => __( 'Replied To', 'buddypress' ),
     
    190190         *
    191191         * @param array $wp_admin_nav See BP_Component::setup_admin_bar()
    192          *        for description.
     192         *                            for description.
    193193         */
    194194        public function setup_admin_bar( $wp_admin_nav = array() ) {
    195195
    196                 // Menus for logged in user
     196                // Menus for logged in user.
    197197                if ( is_user_logged_in() ) {
    198198
    199                         // Setup the logged in user variables
     199                        // Setup the logged in user variables.
    200200                        $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() );
    201201
    202                         // Add the "My Account" sub menus
     202                        // Add the "My Account" sub menus.
    203203                        $wp_admin_nav[] = array(
    204204                                'parent' => buddypress()->my_account_menu_id,
     
    208208                        );
    209209
    210                         // Topics
     210                        // Topics.
    211211                        $wp_admin_nav[] = array(
    212212                                'parent' => 'my-account-' . $this->id,
     
    216216                        );
    217217
    218                         // Replies
     218                        // Replies.
    219219                        $wp_admin_nav[] = array(
    220220                                'parent' => 'my-account-' . $this->id,
     
    224224                        );
    225225
    226                         // Favorites
     226                        // Favorites.
    227227                        $wp_admin_nav[] = array(
    228228                                'parent' => 'my-account-' . $this->id,
     
    241241        public function setup_title() {
    242242
    243                 // Adjust title based on view
     243                // Adjust title based on view.
    244244                if ( bp_is_forums_component() ) {
    245245                        $bp = buddypress();
Note: See TracChangeset for help on using the changeset viewer.