[wp-trac] [WordPress Trac] #24074: Admin bar can provide redirect hook and home button
WordPress Trac
noreply at wordpress.org
Sat Apr 13 12:54:51 UTC 2013
#24074: Admin bar can provide redirect hook and home button
-------------------------------------+-------------------------
Reporter: godhulii_1985 | Type: enhancement
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: 3.5.1 | Severity: normal
Keywords: ux-feedback ui-feedback |
-------------------------------------+-------------------------
If a wordpress theme uses {{{wp_footer()}}} then visiting the site will
provide an admin bar at the top. I think the user experience for this bar
can be extended considering these points:
----
== Enable/Disable ==
# Despite lots of potential information in this bar, a theme owner may not
want to see this in his site. So there should be an option in ''Dashboard
> Settings'' to show/hide this.
[[BR]]
[[BR]]
== Act as Home button ==
# Leftmost anchor element of this bar is '''site-name''' that redirects
the user to http://example.com/wpurl/wp-admin. However there is another
link just below it (Dashboard) that redirect to the same link.
This admin bar is always visible no matter how deep we scroll in a site.
So lets assume, an user (say Bob) has scrolled down for 1000 lines. Then
Bob wish to return to homepage. Facebook or other sites in this situation
provide their site-logo on top-left to return to Home and allow pressing
'''Home''' button in keyboard to go to top of the page. So the admin bar
in this case can provide a link to return to: http://example.com/siteurl.
This way we will skip information duplication (the top-left and Dashboard
both point to same location now), increase information efficiency and
provide a consistent user experience with current trend.
[[BR]]
[[BR]]
== Redirection on Logout ==
# The logout button works as follows: From http://example.com?p=111 page
if Bob click on logout then Bob will be taken to http://example.com/wpurl
/wp-login.php?action=logout. From here Bob have to click to '''back to
Site-name''' link to return to homepage or type http://example.com?p=111
in address bar to return to this page. This is distracting for the user
IMO.
This can be improved as if logout link append an extra parameter where to
redirect the user (in this case window.location.href). This way the user
will not be distracted from his interaction with the site.
'''So long story short:''' there should be a hook for the logout link in
admin bar, taking input on where to redirect once Bob logout.
****
Right now I have implemented these in my site with this way:
{{{
if( is_user_logged_in() )
{
var $logoutURL= $('#wp-admin-bar-logout a');
$logoutURL.attr('href',$logoutURL.attr('href')+'&redirect_to='+window.location);
$('#wp-admin-bar-site-name a').attr('href', get_bloginfo('siteurl') );
}
}}}
Thanks,[[BR]]
-S.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24074>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list