Skip to:
Content

BuddyPress.org

Ticket #4772: subnav.php

File subnav.php, 1.1 KB (added by modemlooper, 7 years ago)

simple plugin that creates subnav under settings

Line 
1<?php
2/*
3Plugin Name: SubNav
4Plugin URI: http://buddypress.org
5Description:
6Version: 1.2.2
7Requires at least: WP 3.4, BuddyPress 1.5
8Tested up to: WP 3.5, BuddyPress 1.7
9License: GNU General Public License 2.0 (GPL) http://www.gnu.org/licenses/gpl.html
10Author: modemlooper
11Author URI: http://twitter.com/modemlooper
12*/
13
14
15
16function 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}
31add_action( 'bp_setup_nav', 'bp_setup_sub_nav' );
32
33
34
35function 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
43function bp_subnav_screen_settings_content() {
44       
45        echo 'Why Roger, why?';
46
47}