• Hi, I’d like to recommend a minor enhancement to the WordPress.com SSO feature. For some reason this plugin insists on using Javascript to wrap the login button and move it down the very bottom of the #loginform. The standard output from hooking into the ‘wp_login_form’ action is below the user ID and password fields and above the remember me checkbox and login button.

    I have other login providers (in my case Facebook and may add Twitter, etc. later) and it looks silly to have login buttons in two different locations on the form. Could you please just output the WordPress.com login button in the default location? Then you can get rid of unnecessary javascript as well and we can even do some styling with simple CSS.

    I do get that it makes some sense to locate it at the very bottom like you did, since technically the existing login button goes with the form fields above it… but then WordPress core should send the output from its action after that as well.

    Also, if you wanted to keep it at the bottom, wouldn’t it make more sense to do that with some absolute positioning CSS instead of javascript?

    Thanks for listening. I know its a small thing, but it would be nice to have things consistent.

    https://www.ads-software.com/plugins/jetpack/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Thanks for the feedback.

    Could you please just output the WordPress.com login button in the default location?

    I’m not sure what you mean by “default location”. Would you move the button above the default “Log in” button?

    wouldn’t it make more sense to do that with some absolute positioning CSS instead of javascript?

    That would probably makes things harder to keep the button in the right place, regardless of the device you use. But we can look into that. I created a new GitHub issue here, where you can subscribe to follow our progress.

    Thread Starter Tim Nicholson

    (@timnicholson)

    Thanks, Jeremy. Without any javascript or CSS, the output of the wp_login_form filter goes below the User ID and Password fields and above the “remember me” and default login button. I don’t particularly care where it goes and one can argue that where Jetpack places it is better, but I’m looking for consistency between WordPress Core and Jetpack.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    Could you give me an example of another plugin hooking into wp_login_form(), so I can run some tests? wp_login_form() includes different filters allowing you hook before, in the middle, or after the form, so we should be able to find an elegant solution somewhere!
    https://core.trac.www.ads-software.com/browser/tags/4.1/src/wp-includes/general-template.php#L385

    Thread Starter Tim Nicholson

    (@timnicholson)

    Hi, Jeremy. I wasn’t aware that wp_login_form lets you hook into different places. That would be an elegant solution, indeed.

    The plugin I’m using for Facebook login is Sociabl.es. Its hook is just basic and it uses no javascript or CSS for positioning:
    add_action( 'login_form', 'fb_wp_login_form');

    You can see my site login here. I’ve styled the Facebook button to look just like the WordPress.com button, but the form looks bad due to the inconsistent button placement.

    I see in the core general-template.php where there are filters for login_form_top, login_form_bottom, and login_form_middle, but I don’t see a way to pass args to the main login_form filter to get it to output at the bottom. And if I filter on login_form_bottom instead of login_form, nothing gets output at all which is strange. The plugin is written to just echo out its HTML. It looks like the logon_form_bottom filter needs the HTML contatenated to the default output and returned rather than directly echo’d.

    Plugin Author Jeremy Herve

    (@jeherve)

    Jetpack Mechanic ??

    It looks like the logon_form_bottom filter needs the HTML contatenated to the default output and returned rather than directly echo’d.

    Yes, that’s correct.

    The login_form action is usually used to add new fields to the log in form, that will be processed when you submit the form. It feels like Sociabl.es’ button doesn’t actually add any information to the form. It bypasses the form completely, much like Jetpack SSO.

    It might consequently make more sense if that button was added below the form, like Jetpack SSO. It’s really an alternative log in option, not an additional field in the existing form.

    If you can’t make the change yourself, it might be worth asking the plugin authors about it and see if they can update their plugin accordingly.

    I hope this helps.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Location of Login Button for WordPress.com Single Sign On’ is closed to new replies.