bbPress

Simple, Fast, Elegant

bbPress support forums » Plugins

Duplicate Messages Tab in Private Message Plugin

(2 posts)
  • Started 4 months ago by djquinn
  • Latest reply from _ck_
  • This topic is not resolved
  1. I have the Private Messages plugin and the Avatar plugin both installed, and whenever I click on the Avatar tab in user profiles, I get two Messages tabs. I added the function suggested in the PM plugin forum:

    function add_pm_tab()
    {
    global $user_id;
    global $self;

    if (bb_get_current_user_info( 'id' ) == $user_id) {
    add_profile_tab(__('Messages'), 'edit_profile', '', 'pm.php');
    }
    }
    add_action( 'bb_profile_menu', 'add_pm_tab' );
    bb_add_filter('get_bb_location', 'get_mess_bb_location');
    bb_add_filter('get_bb_location', 'get_pm_bb_location');

    To display the PM message tab on the users' profiles. Any idea what's causing the tab to duplicate? It only happens when users click on the Avatar tab in their profile.

    Posted 4 months ago #
  2. I had the same problem with my plugins with the avatar tab too. It makes tabs duplicate.

    I'll have to lookup the workaround I did...

    Okay the bug fix I had to use was to wrap the function that adds a tab and check if $self was set.

    ie.

    function add_tab(blah) {
    global $self;
       if (!self) {
         // code that adds tab goes here
       }
    }

    So what you probably need to do is change this line like so:
    if (!$self && bb_get_current_user_info( 'id' ) == $user_id) {

    Posted 4 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.