Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#40791 new enhancement

paginate_links outputs unnecessary dots

Reported by: rphelan's profile rphelan Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.5
Component: General Keywords:
Focuses: ui Cc:


Steps to reproduce:

A) Call paginate_links with current=2, total=6

B) Call paginate_links with current=5, total=6

(assume defaults for everything else: mid_size=2, end_size=1, show_all=false)

Actual results:

A) [1] ... [3] [4] [5] [6]

B) [1] [2] [3] [4] ... [6]

The output includes dots that are unnecessary because they are taking up space that an actual page link could occupy.

Expected results:

A) [1] [2] [3] [4] [5] [6]

B) [1] [2] [3] [4] [5] [6]

When total <= mid_size + end_size * 2 + 2, no dots should be included in the pagination output.

Change History (2)

This ticket was mentioned in Slack in #accessibility by afercia. View the logs.

7 years ago

#2 @afercia
7 years ago

  • Focuses accessibility removed

Removing the accessibility focus, as per today's accessibility bug scrub. While this could be certainly improved, the dots don't introduce specific accessibility issues. While paginate_links() doesn't output fully accessible HTML by default, it can be used in an accessible way using for example prev_text and next_text, which is already done in some places in core.

Note: See TracTickets for help on using tickets.