Skip to:
Content

BuddyPress.org

Ticket #7931: testing.php

File testing.php, 972 bytes (added by dontdream, 7 years ago)

demonstrates possible regression in bp_core_new_subnav_item()

Line 
1<?php
2/*
3Plugin Name: BP Test
4Plugin URI: http://www.dontdream.it/
5Description: Testing bp_core_new_subnav_item().
6Version: 1.0
7Author: Andrea Tarantini
8Author URI: http://www.dontdream.it/
9*/
10
11add_action ('bp_setup_nav', 'test_setup_nav');
12function 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
25function 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
33function test_screen_title ()
34{
35        echo "Test Screen Title";
36}
37
38function test_screen_content ()
39{
40        echo "Test Screen Content";
41}