Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#23178 closed defect (bug) (fixed)

Screen reader shortcut links generated by _render() from WP_Admin_Bar class should use rel="nofolow"

Reported by: marko-m's profile Marko-M Owned by: nacin's profile nacin
Milestone: 3.5.2 Priority: normal
Severity: normal Version:
Component: Toolbar Keywords: has-patch
Focuses: Cc:

Description

Screen reader related links generated by _render() from WP_Admin_Bar class assume toolbar is being shown only to logged in users. When toolbar is being shown to visitors using

function my_set_current_user() {
    if(!is_user_logged_in()){
        add_filter('show_admin_bar', '__return_true');
    }
}
add_action('set_current_user', 'my_set_current_user');

search engines report 403 error code on every page of the website when trying to follow wp_logout_url() from one of these links (Logout link). Including rel="nofollow" into _render() should avoid this.

Attachments (2)

class-wp-admin-bar.php.diff (1.0 KB) - added by Marko-M 11 years ago.
23178.patch (502 bytes) - added by SergeyBiryukov 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @Marko-M
11 years ago

  • Type changed from enhancement to defect (bug)

#2 @SergeyBiryukov
11 years ago

#23859 was marked as a duplicate.

#3 @nacin
11 years ago

  • Milestone changed from Awaiting Review to 3.5.2

We should instead avoid rendering such a link entirely when the user isn't logged in.

#4 @SergeyBiryukov
11 years ago

  • Keywords has-patch added

#5 @nacin
11 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24442:

Don't render the screen reader shortcut 'Log Out' link in the toolbar when the user is not logged in.

props SergeyBiryukov.
fixes #23178.

#6 @nacin
11 years ago

In 24443:

Don't render the screen reader shortcut 'Log Out' link in the toolbar when the user is not logged in.

Merges [24442] to the 3.5 branch.

props SergeyBiryukov.
fixes #23178.

Note: See TracTickets for help on using tickets.