Skip to:
Content
Pages
Categories
Search
Top
Bottom

[BuddyPress Extend Fields] Display fields on user selectable tab


  • Greg McEwan-Marriott
    Participant

    @gregthebuzz

    Trying to add tab not only under Buddypress>Group>Manage BUT also so that visitors can see the tabs and fields readonly on Buddypress Main Tab

    I managed to get the tab added and it to load a blank page with the tab group headers but cannot seem to be able to losd the field. I also tried to include the other-fields.php under bp-extend-groups-fields/templates/groups/single/admin but no go…

    Any ideas? I added the code below to my theme functions.php file to add a tab and page called Info under the main BP nav

    function my_new_groups_info_page() {
    global $bp;
    if (isset($bp->groups->current_group->slug)) {
    		bp_core_new_subnav_item(array(
    		'name' => 'Info',
    		'slug' => 'Info',
    		'parent_slug' => $bp->groups->current_group->slug,
    		'parent_url' => bp_get_group_permalink($bp->groups->current_group),
    		'screen_function' => 'my_new_group_show_screen',
    		'position' => 10));
    		}
    }
    add_action('wp', 'my_new_groups_info_page');
    
    function my_new_group_show_screen() {
    add_action('bp_template_title', 'my_new_group_show_screen_title');
    add_action('bp_template_content', 'my_new_group_show_screen_content');
    		$templates = array('templates/groups/single/plugins.php', 'other-fields.php');
    		if (strstr(locate_template($templates), 'templates/groups/single/plugins.php')) {
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'templates/groups/single/plugins'));
    		} else {
    		bp_core_load_template(apply_filters('bp_core_template_plugin', 'plugin-template'));
    		}
    	}
    function my_new_group_show_screen_title() {
    		echo 'New Tab Title';
    		}
    
    function my_new_group_show_screen_content() {
    
    echo '<div class="clear"></br></div>';		
    echo '<ul class="button-nav" role="navigation">';
    echo bp_extend_fields_group_tabs( );
    echo '<ul>';
    
    echo '<div class="clear"></div>';
    
    include 'templates/groups/single/other-fields.php';
    
    	
    	}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar