• Hi

    I want to use your fabulous plugin inside the wp-adminbar. The admin-bar is set to “always visible”.

    The reason behind it is that this is a buddypress-site which uses the admin-bar for everything so it is a must to be able to login from there also.

    I thought I could to it like this:

    function login_form() {
        global $wp_admin_bar;
    
        $wp_admin_bar->add_menu( array(
            'id' => 'wpse-form-in-admin-bar',
            'title' => login_with_ajax( array(
                'template' => 'in-menu'
            ))
        ) );
    }
    
    add_action( 'wp_before_admin_bar_render', 'login_form' );

    “in-menu” is at the moment only a copy of “divs-only”-theme. However, the menu renders not in the menu but just before <div id=”wpadminbar”>

    What am I doing wrong?

    Btw, if I do

    $wp_admin_bar->add_menu( array(
       'id' => 'wpse-form-in-admin-bar',
       'title' => '<div>TEST</div>'
    ) );

    it renders at the expected place.

    Thanks for any insight!
    Raphael

    https://wordpress.org/plugins/login-with-ajax/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter RaphaelJeger

    (@raphaeljeger)

    To be a bit more specific (and because I saw I’m not the only one with this request), the <div class="lwa lwa-divs-only"> from my template (which is everything I should change to remain update-compatible) renders just before the <div id="wpadminbar"> no matter where I place it.

    I can’t even find where the code that renders this is and I don’t get it how I should be able to change that without breaking update compatibility…

    Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry but at the moment you need custom coding to make this work and we don’t have ready snippet for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add login form etc. to wp-adminbar’ is closed to new replies.