Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/23/2015 03:55:00 AM (11 years ago)
Author:
tw2113
Message:

More documentation cleanup for BP-Blogs component.

See #6397.

File:
1 edited

Legend:

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

    r10110 r10374  
    1111 */
    1212
    13 // Exit if accessed directly
     13// Exit if accessed directly.
    1414defined( 'ABSPATH' ) || exit;
    1515
     16/**
     17 * Creates our Blogs component.
     18 */
    1619class BP_Blogs_Component extends BP_Component {
    1720
     
    5255                }
    5356
    54                 // Global tables for messaging component
     57                // Global tables for messaging component.
    5558                $global_tables = array(
    5659                        'table_name'          => $bp->table_prefix . 'bp_user_blogs',
     
    6669                        'slug'                  => BP_BLOGS_SLUG,
    6770                        'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
    68                         'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site
     71                        'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site.
    6972                        'directory_title'       => _x( 'Sites', 'component directory title', 'buddypress' ),
    7073                        'notification_callback' => 'bp_blogs_format_notifications',
     
    7578                );
    7679
    77                 // Setup the globals
     80                // Setup the globals.
    7881                parent::setup_globals( $args );
    7982
    80                 /*
     83                /**
    8184                 * Filters if a blog is public.
    8285                 *
     
    8588                 * @since 2.3.0
    8689                 *
    87                  * @oaram int $value Whether or not the blog is public.
     90                 * @param int $value Whether or not the blog is public.
    8891                 */
    8992                if ( 0 !== apply_filters( 'bp_is_blog_public', (int) get_option( 'blog_public' ) ) || ! is_multisite() ) {
     
    117120        public function includes( $includes = array() ) {
    118121
    119                 // Files to include
     122                // Files to include.
    120123                $includes = array(
    121124                        'cache',
     
    133136                }
    134137
    135                 // Include the files
     138                // Include the files.
    136139                parent::includes( $includes );
    137140        }
     
    158161                }
    159162
    160                 // Determine user to use
     163                // Determine user to use.
    161164                if ( bp_displayed_user_domain() ) {
    162165                        $user_domain = bp_displayed_user_domain();
     
    170173                $parent_url = trailingslashit( $user_domain . $slug );
    171174
    172                 // Add 'Sites' to the main navigation
     175                // Add 'Sites' to the main navigation.
    173176                $count    = (int) bp_get_total_blog_count_for_user();
    174177                $class    = ( 0 === $count ) ? 'no-count' : 'count';
     
    192195                );
    193196
    194                 // Setup navigation
     197                // Setup navigation.
    195198                parent::setup_nav( $main_nav, $sub_nav );
    196199        }
     
    205208         * @param array $wp_admin_nav See BP_Component::setup_admin_bar()
    206209         *                            for description.
    207          *
    208210         * @return bool
    209211         */
     
    219221                }
    220222
    221                 // Menus for logged in user
     223                // Menus for logged in user.
    222224                if ( is_user_logged_in() ) {
    223225
    224                         // Setup the logged in user variables
     226                        // Setup the logged in user variables.
    225227                        $blogs_link = trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() );
    226228
    227                         // Add the "Sites" sub menu
     229                        // Add the "Sites" sub menu.
    228230                        $wp_admin_nav[] = array(
    229231                                'parent' => buddypress()->my_account_menu_id,
     
    233235                        );
    234236
    235                         // My Sites
     237                        // My Sites.
    236238                        $wp_admin_nav[] = array(
    237239                                'parent' => 'my-account-' . $this->id,
     
    241243                        );
    242244
    243                         // Create a Site
     245                        // Create a Site.
    244246                        if ( bp_blog_signup_enabled() ) {
    245247                                $wp_admin_nav[] = array(
     
    256258
    257259        /**
    258          * Set up the title for pages and <title>
     260         * Set up the title for pages and <title>.
    259261         */
    260262        public function setup_title() {
    261263
    262                 // Set up the component options navigation for Site
     264                // Set up the component options navigation for Site.
    263265                if ( bp_is_blogs_component() ) {
    264266                        $bp = buddypress();
     
    270272
    271273                        // If we are not viewing the logged in user, set up the current
    272                         // users avatar and name
     274                        // users avatar and name.
    273275                        } else {
    274276                                $bp->bp_options_avatar = bp_core_fetch_avatar( array(
     
    291293        public function setup_cache_groups() {
    292294
    293                 // Global groups
     295                // Global groups.
    294296                wp_cache_add_global_groups( array(
    295297                        'blog_meta'
     
    306308         * @see bp_activity_get_post_type_tracking_args() for information on parameters.
    307309         *
    308          * @param object|null $params
    309          * @param string|int  $post_type
    310          *
     310         * @param object|null $params    Tracking arguments.
     311         * @param string|int  $post_type Post type to track.
    311312         * @return object
    312313         */
Note: See TracChangeset for help on using the changeset viewer.