Skip to:
Content
Pages
Categories
Search
Top
Bottom

Changing log in menu-item (buddypress 1.5)

  • I’ve read the tutorials, and am trying to alter the log-in item on the buddypress menu. I want to replace it with an Ajax login so it will stay on the current page, but the first step is to disable the existing log-in. I’m using this code in functions.php to try to disable it:

    remove_action( ‘bp_adminbar_menus’, ‘bp_adminbar_login_menu’);

    I’ve looked at the Buddypress code in file bp-core-buddybar.php, and this code seems correct, and all the tutorials I’ve found say it is. When I add it to functions.php in the theme used by my main installation, it works as expected and the login menu for the main site (call it site.com) is disabled.

    But I can’t get the login menu to disable on the subdomain sites (call it sub.site.com) Those sites are running a different theme than the “parent” site, but adding the same code to the theme they run doesn’t disable the menu.

    I tried running the subdomain blog with the parent theme, and the login menu correctly disables, so this is probably a theme-problem, rather than a subdomain problem. What sorts of things should I look for in my custom theme, that could prevent disabling the menu from working?

Viewing 3 replies - 1 through 3 (of 3 total)

  • modemlooper
    Moderator

    @modemlooper

    What about putting the remove action in the sub domains functions.php file?


    modemlooper
    Moderator

    @modemlooper

    remove action bp_login

    create you’re own function for login then add action

    Then, remove it from sub themes

    I did add that same code to the functions.php for the theme the subdomain is running — it didn’t work there.

    As I continued to experiment, I thought it would be useful to disable something in the logged-in state so I could more easily see when it was working without logging in and out (to switch themes and such.) In doing so I figured out that I have to use the priority the menu-item was originally added with:

    add_action( ‘bp_adminbar_menus’, ‘bp_adminbar_thisblog_menu’, 6 );

    becomes:

    remove_action(‘bp_adminbar_menus’, ‘bp_adminbar_thisblog_menu’, 6);

    Without the “6” it won’t work. I’ve tried it with the priority I found in bp-core-buddybar.php, but since it does work in one theme and not another I’m wondering if maybe a theme can change this somewhere?

    EDIT: Yup, a theme can change it … if it overwrites the original function with one with a new name but exactly the same code. *headdesk*. Searching for a unique bit of CSS I tracked down where the login code was actually being generated — not by buddypress, but not visually distinct from it either.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing log in menu-item (buddypress 1.5)’ is closed to new replies.
Skip to toolbar