Ticket #1251: remove-create-blog-link.patch
File remove-create-blog-link.patch, 3.1 KB (added by , 15 years ago) |
---|
-
bp-themes/bp-sn-parent/blogs/my-blogs.php
32 32 <?php else: ?> 33 33 34 34 <div id="message" class="info"> 35 <p><?php bp_word_or_name( __( "You haven't created any blogs yet.", 'buddypress' ), __( "%s hasn't created any public blogs yet.", 'buddypress' ) ) ?> <?php bp_create_blog_link() ?> </p>35 <p><?php bp_word_or_name( __( "You haven't created any blogs yet.", 'buddypress' ), __( "%s hasn't created any public blogs yet.", 'buddypress' ) ) ?> <?php if ( bp_can_create_blogs()) bp_create_blog_link() ?> </p> 36 36 </div> 37 37 38 38 <?php endif;?> -
bp-blogs.php
131 131 } 132 132 add_action( 'plugins_loaded', 'bp_blogs_setup_root_component', 2 ); 133 133 134 function bp_can_create_blogs() { 135 $active_signup = get_site_option( 'registration' ); 136 if( !$active_signup ) 137 $active_signup = 'all'; 138 139 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); 140 141 if ( is_site_admin() ) 142 return true; 143 if ( ( $active_signup == 'blog' || $active_signup == 'all' ) && is_user_logged_in() ) 144 return true; 145 146 return false; 147 } 148 134 149 /** 135 150 * bp_blogs_setup_nav() 136 151 * … … 142 157 */ 143 158 function bp_blogs_setup_nav() { 144 159 global $bp; 145 160 146 161 /* Add 'Blogs' to the main navigation */ 147 162 bp_core_new_nav_item( array( 'name' => __( 'Blogs', 'buddypress' ), 'slug' => $bp->blogs->slug, 'position' => 30, 'screen_function' => 'bp_blogs_screen_my_blogs', 'default_subnav_slug' => 'my-blogs', 'item_css_id' => $bp->blogs->id ) ); 148 163 … … 152 167 bp_core_new_subnav_item( array( 'name' => __( 'My Blogs', 'buddypress' ), 'slug' => 'my-blogs', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_my_blogs', 'position' => 10, 'item_css_id' => 'my-blogs-list' ) ); 153 168 bp_core_new_subnav_item( array( 'name' => __( 'Recent Posts', 'buddypress' ), 'slug' => 'recent-posts', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_recent_posts', 'position' => 20 ) ); 154 169 bp_core_new_subnav_item( array( 'name' => __( 'Recent Comments', 'buddypress' ), 'slug' => 'recent-comments', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_recent_comments', 'position' => 30 ) ); 155 bp_core_new_subnav_item( array( 'name' => __( 'Create a Blog', 'buddypress' ), 'slug' => 'create-a-blog', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_create_a_blog', 'position' => 40 ) ); 170 if ( bp_can_create_blogs() ) 171 bp_core_new_subnav_item( array( 'name' => __( 'Create a Blog', 'buddypress' ), 'slug' => 'create-a-blog', 'parent_url' => $blogs_link, 'parent_slug' => $bp->blogs->slug, 'screen_function' => 'bp_blogs_screen_create_a_blog', 'position' => 40 ) ); 156 172 157 173 /* Set up the component options navigation for Blog */ 158 174 if ( 'blogs' == $bp->current_component ) {