Support » Plugins » Hacks » Custom login form to wordpress admin bar?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz


    So you want the actual login fields to appear in a drop down from the admin bar? I’m confused. The admin bar only displays after one is logged in, so what is the point of offering login fields?

    Nope, the admin bar can be set to be visible always even when no one is logged in to website, so my point is to gather all data, links, profile info, to one place on network of websites, and this is the login bar, so when you are not loged in to show you the login form.

    I btw found the solution but it’s still not the best one, maybe a few more tweaks but it works.

    To always show login bar it’s simple code like this

    add_filter( 'show_admin_bar', '__return_true' );

    And login form that i have working on website now is this.

    $wp_admin_bar->add_node( array(
    		'id' => 'loginform',
    		'parent' => 'top-secondary',
    		'title' => '<form action="' .wp_login_url(). '" method="post">
    					<input type="text" id="inputUname" name="log" placeholder="Username" >
    					<input type="password" id="inputPassword" name="pwd" placeholder="Password">
    					<input type="checkbox" name="rememberme" id="rememberme" checked="checked" value="forever" >Remember me?
    					<input type="hidden" name="redirect_to" value="' .$_SERVER['REQUEST_URI']. '" />
    					<button type="submit" class="btn btn-info" name="submit" value="Send">Login</button>
    		) );

    It’s still in the work though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom login form to wordpress admin bar?’ is closed to new replies.