Helping you Build Your Own Social Network!

Faster, better and easier!

Create New Sub-Nav Item with own function

(1 post) (1 voice)
  • Started 4 months ago by towfiq

Tags:

No tags yet.


  1. I have installed this "Posts on Profile" plugin that shows the list of posts made by the users by adding a "Posts" tab to user profile navigation. Here is the link to the plugin:
    http://nxsn.com/projects/bp-posts-on-profile/

    Now, what i want to do is add a new sub navigation in the "Posts" navigation with my own function. I tried this with no avail:

    function posts_subnav_hook() {
        global $bp;
    
        bp_core_new_subnav_item( array(
            'name' => 'Create New Post' ,
            'slug' => 'create',
            'parent_slug' => $bp->postsonprofile->slug,
            'parent_url' => $postsonprofile_link,
            'position' => 10,
            'screen_function' => 'my_own_function',
            'user_has_access' => bp_is_my_profile()
        ) );
    }
    add_action( 'wp', 'posts_subnav_hook', 2 );
    add_action( 'admin_menu', 'posts_subnav_hook', 2 );

    Here is the core file of the plugin:
    http://pastebin.com/mhTa4KHp

    Please Help!!

    Posted 4 months ago #

Reply

You must log in to post.