| 1 | <?php
|
|---|
| 2 | /*
|
|---|
| 3 | Plugin Name: SubNav
|
|---|
| 4 | Plugin URI: http://buddypress.org
|
|---|
| 5 | Description:
|
|---|
| 6 | Version: 1.2.2
|
|---|
| 7 | Requires at least: WP 3.4, BuddyPress 1.5
|
|---|
| 8 | Tested up to: WP 3.5, BuddyPress 1.7
|
|---|
| 9 | License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
|
|---|
| 10 | Author: modemlooper
|
|---|
| 11 | Author URI: http://twitter.com/modemlooper
|
|---|
| 12 | */
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | function bp_setup_sub_nav() {
|
|---|
| 17 | global $bp;
|
|---|
| 18 |
|
|---|
| 19 | // Add a nav item for this
|
|---|
| 20 | bp_core_new_subnav_item( array(
|
|---|
| 21 | 'name' => __( 'SubNav', 'bp-subnavy' ),
|
|---|
| 22 | 'slug' => 'subnav',
|
|---|
| 23 | 'parent_slug' => $bp->settings->slug,
|
|---|
| 24 | 'parent_url' => $bp->displayed_user->domain . $bp->settings->slug . '/',
|
|---|
| 25 | 'screen_function' => 'bp_subnav_screen_settings_menu',
|
|---|
| 26 | 'position' => 40,
|
|---|
| 27 | 'user_has_access' => bp_is_my_profile()
|
|---|
| 28 | ) );
|
|---|
| 29 |
|
|---|
| 30 | }
|
|---|
| 31 | add_action( 'bp_setup_nav', 'bp_setup_sub_nav' );
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | function bp_subnav_screen_settings_menu() {
|
|---|
| 36 |
|
|---|
| 37 | add_action( 'bp_template_content', 'bp_subnav_screen_settings_content' );
|
|---|
| 38 | bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
|
|---|
| 39 |
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 | function bp_subnav_screen_settings_content() {
|
|---|
| 44 |
|
|---|
| 45 | echo 'Why Roger, why?';
|
|---|
| 46 |
|
|---|
| 47 | }
|
|---|