<?php
/*
Plugin Name: SubNav
Plugin URI: http://buddypress.org
Description: 
Version: 1.2.2
Requires at least: WP 3.4, BuddyPress 1.5
Tested up to: WP 3.5, BuddyPress 1.7
License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
Author: modemlooper 
Author URI: http://twitter.com/modemlooper
*/



function bp_setup_sub_nav() {
	global $bp;
	
		// Add a nav item for this 
	bp_core_new_subnav_item( array(
		'name' => __( 'SubNav', 'bp-subnavy' ),
		'slug' => 'subnav',
		'parent_slug' => $bp->settings->slug,
		'parent_url' => $bp->displayed_user->domain . $bp->settings->slug . '/',
		'screen_function' => 'bp_subnav_screen_settings_menu',
		'position' => 40,
		'user_has_access' => bp_is_my_profile()
	) );
	
}
add_action( 'bp_setup_nav', 'bp_setup_sub_nav' );



function bp_subnav_screen_settings_menu() {
	
	add_action( 'bp_template_content', 'bp_subnav_screen_settings_content' );
	bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
	
}


function bp_subnav_screen_settings_content() {
	
	echo 'Why Roger, why?';

}