Changeset 9936 for trunk/src/bp-blogs/bp-blogs-loader.php
- Timestamp:
- 06/11/2015 06:53:59 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-loader.php
r9898 r9936 144 144 */ 145 145 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 146 $bp = buddypress();147 146 148 147 /** … … 155 154 } 156 155 157 // Add 'Sites' to the main navigation158 $count = (int) bp_get_total_blog_count_for_user();159 $class = ( 0 === $count ) ? 'no-count' : 'count';160 $nav_text = sprintf( __( 'Sites <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), number_format_i18n( $count ) );161 $main_nav = array(162 'name' => $nav_text,163 'slug' => $this->slug,164 'position' => 30,165 'screen_function' => 'bp_blogs_screen_my_blogs',166 'default_subnav_slug' => 'my-sites',167 'item_css_id' => $this->id168 );169 170 156 // Determine user to use 171 157 if ( bp_displayed_user_domain() ) { … … 177 163 } 178 164 179 $parent_url = trailingslashit( $user_domain . bp_get_blogs_slug() ); 165 $slug = bp_get_blogs_slug(); 166 $parent_url = trailingslashit( $user_domain . $slug ); 167 168 // Add 'Sites' to the main navigation 169 $count = (int) bp_get_total_blog_count_for_user(); 170 $class = ( 0 === $count ) ? 'no-count' : 'count'; 171 $nav_text = sprintf( __( 'Sites <span class="%s">%s</span>', 'buddypress' ), esc_attr( $class ), bp_core_number_format( $count ) ); 172 $main_nav = array( 173 'name' => $nav_text, 174 'slug' => $slug, 175 'position' => 30, 176 'screen_function' => 'bp_blogs_screen_my_blogs', 177 'default_subnav_slug' => 'my-sites', 178 'item_css_id' => $this->id 179 ); 180 180 181 181 $sub_nav[] = array( … … 183 183 'slug' => 'my-sites', 184 184 'parent_url' => $parent_url, 185 'parent_slug' => $ bp->blogs->slug,185 'parent_slug' => $slug, 186 186 'screen_function' => 'bp_blogs_screen_my_blogs', 187 187 'position' => 10 … … 203 203 */ 204 204 public function setup_admin_bar( $wp_admin_nav = array() ) { 205 $bp = buddypress();206 205 207 206 /** … … 217 216 if ( is_user_logged_in() ) { 218 217 219 $blogs_link = trailingslashit( bp_loggedin_user_domain() . $this->slug ); 218 // Setup the logged in user variables 219 $blogs_link = trailingslashit( bp_loggedin_user_domain() . bp_get_blogs_slug() ); 220 220 221 221 // Add the "Sites" sub menu 222 222 $wp_admin_nav[] = array( 223 'parent' => $bp->my_account_menu_id,223 'parent' => buddypress()->my_account_menu_id, 224 224 'id' => 'my-account-' . $this->id, 225 225 'title' => __( 'Sites', 'buddypress' ), 226 'href' => trailingslashit( $blogs_link )226 'href' => $blogs_link 227 227 ); 228 228 … … 232 232 'id' => 'my-account-' . $this->id . '-my-sites', 233 233 'title' => __( 'My Sites', 'buddypress' ), 234 'href' => trailingslashit( $blogs_link )234 'href' => $blogs_link 235 235 ); 236 236 … … 253 253 */ 254 254 public function setup_title() { 255 $bp = buddypress();256 255 257 256 // Set up the component options navigation for Site 258 257 if ( bp_is_blogs_component() ) { 258 $bp = buddypress(); 259 259 260 if ( bp_is_my_profile() ) { 260 261 if ( bp_is_active( 'xprofile' ) ) { … … 300 301 */ 301 302 public function post_tracking_args( $params = null, $post_type = 0 ) { 303 302 304 /** 303 305 * Filters the post types to track for the Blogs component.
Note: See TracChangeset
for help on using the changeset viewer.