WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#31349 closed defect (bug) (fixed)

Screen options posts/pages/etc. per page label

Reported by: afercia Owned by: ocean90
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.1
Component: Administration Keywords: needs-patch
Focuses: ui, accessibility Cc:

Description

One small thing reported by Jeff de Wit from the accessibility testers group that wasn't included in the last testing session summary:

The label for the posts per page (under screen options) just says "Posts" (or "Pages", or "Comments", or whatever list page you're on). ChromeVox simply announces it as such ("Posts, 20, edit text and numeric only"). It doesn't seem clear that it changes the amount of posts/pages/comments/whatever per page in the admin.

See screenshot:

https://cldup.com/t93WuJzp2y.png

Proposed patch just add some more context to the label text. Also some minor CSS adjustments. See screenshot after the patch:

https://cldup.com/6cykQ1CmRh.png

Attachments (4)

31349.patch (1.2 KB) - added by afercia 6 years ago.
31349.2.patch (1.2 KB) - added by afercia 6 years ago.
31349.3.patch (8.1 KB) - added by afercia 6 years ago.
31349.4.patch (8.5 KB) - added by afercia 6 years ago.

Download all attachments as: .zip

Change History (20)

@afercia
6 years ago

#1 @afercia
6 years ago

  • Keywords has-patch added

#2 follow-up: @ocean90
6 years ago

  • Keywords needs-patch added; has-patch removed

The string in 31349.patch isn't translatable. Some related tickets for this string: #13673, #15576

@afercia
6 years ago

#3 in reply to: ↑ 2 @afercia
6 years ago

Replying to ocean90:

The string in 31349.patch isn't translatable.

Sorry, totally forgot that. Aging issues :) See updated patch. I would propose to just add "per page" for now, which I guess it makes sense in all languages as translatable string. This would give some useful context to screen reader users, and handle the items singular/plural forms in the other tickets.

#4 @afercia
6 years ago

  • Keywords has-patch added; needs-patch removed

#5 @ocean90
6 years ago

printf( '%1$s %2$s', $per_page_label, __( 'per page' ) );: This won't work for languages which need to translate this into something like per $per_page_label page.

#15576 proposes using "Items" always (I'm +1 for it), that would make this easier.

#6 @afercia
6 years ago

+1 for semplification.
@pavelevap suggested something like "number of items per page".
It would be great to reach some consensus for such a small thing after 4 years and no progress in the last 20 months :)
Then, what about $per_page_label ? it will work just as a "flag"?

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


6 years ago

@afercia
6 years ago

#8 @afercia
6 years ago

Updated patch, as per Slack conversation and based on @pavelevap comment on related ticket https://core.trac.wordpress.org/ticket/15576#comment:21 uses always the same text in all screens. See example before/after screenshot:

https://cldup.com/u0JJRehRAf.png

#9 @pavelevap
6 years ago

I love it, please commit :-)

"Number of items per page: %" would be more flexible for example for RTL languages, but there is not probably easy way in this case.

#10 @ocean90
6 years ago

  • Milestone changed from Awaiting Review to 4.2
  • Owner set to ocean90
  • Status changed from new to accepted

I think we should enhance render_per_page_options() to make 'label' => __( 'Number of items per page:' ) default.

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


6 years ago

@afercia
6 years ago

#12 @afercia
6 years ago

Refreshed patch. Use the new string as default in render_per_page_options() as per @ocean90 suggestion.

#13 @DrewAPicture
6 years ago

  • Keywords commit added

#14 @ocean90
6 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 31696:

Screen Options: Improve items per page option label.

Previously the label just said "Posts", "Pages", or "Comments". This was bad in terms of accessibility and internationalization because of missing context.
This change adds a default label "Number of items per page:" to WP_Screen->render_per_page_options() and removes all the existing one-word labels.

props afercia.
fixes #31349, #15576.

#15 @johnbillion
6 years ago

  • Keywords needs-patch added; has-patch commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

r31696 broke the <title> on the Posts screen and the Pages screen.

#16 @SergeyBiryukov
6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 31709:

Restore <title> tag on Posts and Pages screens after [31696].

fixes #31349.

Note: See TracTickets for help on using tickets.