Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#44056 closed defect (bug) (fixed)

Fix markup for table of contents on privacy policy guide

Reported by: ocean90's profile ocean90 Owned by: azaozz's profile azaozz
Milestone: 4.9.6 Priority: normal
Severity: normal Version: 5.1
Component: Privacy Keywords: gdpr has-patch commit
Focuses: ui, accessibility Cc:


There are a few issues with current ToC:

  1. The Introduction link has an empty anchor. It should have a specific one just like the others:
  2. Instead of the empty anchor tag the ID can be directly assigned to the headline:
  3. The date format should be consistent across the admin, see [35811]. get_option( 'date_format' ) needs to be replaced:
  4. The ToC IDs are not guaranteed to be unique on the page. I suggest to prefix them with policy-<plugin name> or something else:

Attachments (2)

44056.patch (1.4 KB) - added by azaozz 6 years ago.
44056.2.patch (1.6 KB) - added by ocean90 6 years ago.

Download all attachments as: .zip

Change History (9)

6 years ago

#1 @azaozz
6 years ago

In 44056.patch:

  • Add ID to the "Introduction" heading and use it to scroll to it.
  • Add translatable date format instead of user selected one.
  • Add prefix to HTML IDs used for the ToC.

We can't add IDs to the headings as they are "too low". Unfortunately the browsers scroll-into-view is still somewhat buggy and doersn't take into account HTML elements that may cover the top. If we add the IDs to the headings or use empty anchors, the actual headings are scrolled under the admin toolbar. Tested in FF, Chrome, Edge and IE11, all do that :(

#2 @azaozz
6 years ago

  • Keywords has-patch added; needs-patch removed

This ticket was mentioned in Slack in #core by desrosj. View the logs.

6 years ago

6 years ago

#4 @ocean90
6 years ago

  • Keywords commit added

Let's go with 44056.2.patch for now.

As mentioned on Slack, I tried the :target way but then I remembered that it requires a huge gap between the sections otherwise you wouldn't be able to click the Copy button anymore due to the negativ top margin.

#5 @azaozz
6 years ago

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

In 43265:

Privacy: fix markup for the table of contents on privacy policy guide screen.

Props ocean90, azaozz.
Fixes #44056.

#6 @azaozz
6 years ago

In 43266:

Privacy: fix markup for the table of contents on privacy policy guide screen.

Props ocean90, azaozz.
Merges [43265] to the 4.9 branch.
Fixes #44056.

#7 @desrosj
6 years ago

  • Component changed from Administration to Privacy

Moving to the new Privacy component.

Note: See TracTickets for help on using tickets.