Page 1 of 4
Button in place of Text for Logout on Login Widget
Posted: Mon Apr 03, 2017 11:20 pm
by axew3
This will be maybe added on next 1.6.9, but as asked (and after removed) on another topic, here the easy way to replace text logout with a button on WP_w3all Login Widget:
open
views/login_form_include_iframe_mode_links.php
or
views/login_form_include_noiframe_mode_links.php (if on iframe or not)
search for this code:
Code: Select all
<a class="button" href="<?php echo wp_logout_url(); ?>"><?php echo __('Logout' , 'wp-w3all-phpbb-integration' ); ?></a>
replace with:
Code: Select all
<form action="<?php echo wp_logout_url(); ?>">
<input class="" type="submit" value="<?php echo __('Logout' , 'wp-w3all-phpbb-integration' ); ?>" />
</form>
1.6.8 has just been released.
Re: Button in place of Text for Logout on Login Widget
Posted: Tue Apr 04, 2017 6:01 am
by Goofkop
Thank You very much!
It looks very nice but i didn't logout when i click on it.
Re: Button in place of Text for Logout on Login Widget
Posted: Tue Apr 04, 2017 9:02 am
by axew3
as in place i will give you the right code so ...
strange, it should work!
p.s there are several easy way to achieve ...
Re: Button in place of Text for Logout on Login Widget
Posted: Tue Apr 04, 2017 12:28 pm
by Goofkop
I changed:
<a href="<?php echo wp_logout_url(); ?>"><?php echo __('Logout' , 'wp-w3all-phpbb-integration' ); ?></a>
In:
<form action="<?php echo wp_logout_url(); ?>">
<input class="" type="submit" value="<?php echo __('Logout' , 'wp-w3all-phpbb-integration' ); ?>" />
</form>
The first code is a little bit different than the yours.
Re: Button in place of Text for Logout on Login Widget
Posted: Tue Apr 04, 2017 12:42 pm
by Goofkop
When i click on logout i am going to the following url:
http://www.bakkersbaas.nl/wp-login.php?
And i see this:
http://imgur.com/a/AiYmQ
With the old code i click on logout and automatically i am going to this url:
http://www.bakkersbaas.nl/wp-login.php?loggedout=true
And i see this:
http://imgur.com/a/GGwC9 (which says: You have been logged out!
Re: Button in place of Text for Logout on Login Widget
Posted: Tue Apr 04, 2017 12:46 pm
by axew3
Yes it is different, but both are working on my fly tests.
this output the wp_logout url
in the default it is inside a text link:
Code: Select all
<a href="<?php echo wp_logout_url(); ?>"
in the second output into button
Code: Select all
<form action="<?php echo wp_logout_url(); ?>">
<input class="" type="submit"
the above is working on my test, but try just this instead:
Code: Select all
<input type="button" onclick="location.href='<?php echo wp_logout_url(); ?>';" value="Logout" />