Changeset 10374 for trunk/src/bp-blogs/bp-blogs-loader.php
- Timestamp:
- 11/23/2015 03:55:00 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-loader.php
r10110 r10374 11 11 */ 12 12 13 // Exit if accessed directly 13 // Exit if accessed directly. 14 14 defined( 'ABSPATH' ) || exit; 15 15 16 /** 17 * Creates our Blogs component. 18 */ 16 19 class BP_Blogs_Component extends BP_Component { 17 20 … … 52 55 } 53 56 54 // Global tables for messaging component 57 // Global tables for messaging component. 55 58 $global_tables = array( 56 59 'table_name' => $bp->table_prefix . 'bp_user_blogs', … … 66 69 'slug' => BP_BLOGS_SLUG, 67 70 '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. 69 72 'directory_title' => _x( 'Sites', 'component directory title', 'buddypress' ), 70 73 'notification_callback' => 'bp_blogs_format_notifications', … … 75 78 ); 76 79 77 // Setup the globals 80 // Setup the globals. 78 81 parent::setup_globals( $args ); 79 82 80 /* 83 /** 81 84 * Filters if a blog is public. 82 85 * … … 85 88 * @since 2.3.0 86 89 * 87 * @ oaram int $value Whether or not the blog is public.90 * @param int $value Whether or not the blog is public. 88 91 */ 89 92 if ( 0 !== apply_filters( 'bp_is_blog_public', (int) get_option( 'blog_public' ) ) || ! is_multisite() ) { … … 117 120 public function includes( $includes = array() ) { 118 121 119 // Files to include 122 // Files to include. 120 123 $includes = array( 121 124 'cache', … … 133 136 } 134 137 135 // Include the files 138 // Include the files. 136 139 parent::includes( $includes ); 137 140 } … … 158 161 } 159 162 160 // Determine user to use 163 // Determine user to use. 161 164 if ( bp_displayed_user_domain() ) { 162 165 $user_domain = bp_displayed_user_domain(); … … 170 173 $parent_url = trailingslashit( $user_domain . $slug ); 171 174 172 // Add 'Sites' to the main navigation 175 // Add 'Sites' to the main navigation. 173 176 $count = (int) bp_get_total_blog_count_for_user(); 174 177 $class = ( 0 === $count ) ? 'no-count' : 'count'; … … 192 195 ); 193 196 194 // Setup navigation 197 // Setup navigation. 195 198 parent::setup_nav( $main_nav, $sub_nav ); 196 199 } … … 205 208 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 206 209 * for description. 207 *208 210 * @return bool 209 211 */ … … 219 221 } 220 222 221 // Menus for logged in user 223 // Menus for logged in user. 222 224 if ( is_user_logged_in() ) { 223 225 224 // Setup the logged in user variables 226 // Setup the logged in user variables. 225 227 $blogs_link = trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ); 226 228 227 // Add the "Sites" sub menu 229 // Add the "Sites" sub menu. 228 230 $wp_admin_nav[] = array( 229 231 'parent' => buddypress()->my_account_menu_id, … … 233 235 ); 234 236 235 // My Sites 237 // My Sites. 236 238 $wp_admin_nav[] = array( 237 239 'parent' => 'my-account-' . $this->id, … … 241 243 ); 242 244 243 // Create a Site 245 // Create a Site. 244 246 if ( bp_blog_signup_enabled() ) { 245 247 $wp_admin_nav[] = array( … … 256 258 257 259 /** 258 * Set up the title for pages and <title> 260 * Set up the title for pages and <title>. 259 261 */ 260 262 public function setup_title() { 261 263 262 // Set up the component options navigation for Site 264 // Set up the component options navigation for Site. 263 265 if ( bp_is_blogs_component() ) { 264 266 $bp = buddypress(); … … 270 272 271 273 // If we are not viewing the logged in user, set up the current 272 // users avatar and name 274 // users avatar and name. 273 275 } else { 274 276 $bp->bp_options_avatar = bp_core_fetch_avatar( array( … … 291 293 public function setup_cache_groups() { 292 294 293 // Global groups 295 // Global groups. 294 296 wp_cache_add_global_groups( array( 295 297 'blog_meta' … … 306 308 * @see bp_activity_get_post_type_tracking_args() for information on parameters. 307 309 * 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. 311 312 * @return object 312 313 */
Note: See TracChangeset
for help on using the changeset viewer.