1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: BP Test |
---|
4 | Plugin URI: http://www.dontdream.it/ |
---|
5 | Description: Testing bp_core_new_subnav_item(). |
---|
6 | Version: 1.0 |
---|
7 | Author: Andrea Tarantini |
---|
8 | Author URI: http://www.dontdream.it/ |
---|
9 | */ |
---|
10 | |
---|
11 | add_action ('bp_setup_nav', 'test_setup_nav'); |
---|
12 | function test_setup_nav () |
---|
13 | { |
---|
14 | bp_core_new_subnav_item (array ( |
---|
15 | 'name' => 'Testing', |
---|
16 | 'slug' => 'testing', |
---|
17 | 'parent_url' => bp_displayed_user_domain (). bp_get_settings_slug (). '/', |
---|
18 | 'parent_slug' => bp_get_settings_slug (), |
---|
19 | 'screen_function' => 'test_screen', |
---|
20 | 'position' => 40, |
---|
21 | 'user_has_access' => bp_core_can_edit_settings (), |
---|
22 | )); |
---|
23 | } |
---|
24 | |
---|
25 | function test_screen () |
---|
26 | { |
---|
27 | add_action ('bp_template_title', 'test_screen_title'); |
---|
28 | add_action ('bp_template_content', 'test_screen_content'); |
---|
29 | |
---|
30 | bp_core_load_template ('members/single/plugins'); |
---|
31 | } |
---|
32 | |
---|
33 | function test_screen_title () |
---|
34 | { |
---|
35 | echo "Test Screen Title"; |
---|
36 | } |
---|
37 | |
---|
38 | function test_screen_content () |
---|
39 | { |
---|
40 | echo "Test Screen Content"; |
---|
41 | } |
---|