[wp-trac] [WordPress Trac] #19958: Allow custom post types as "home" and get_posts() to return results for more than one post type

WordPress Trac noreply at wordpress.org
Thu Sep 10 15:58:22 UTC 2020


#19958: Allow custom post types as "home" and get_posts() to return results for
more than one post type
-------------------------------------+-------------------------------------
 Reporter:  sooskriszta              |       Owner:  pbearne
     Type:  enhancement              |      Status:  accepted
 Priority:  normal                   |   Milestone:
Component:  Posts, Post Types        |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing needs-     |     Focuses:  accessibility,
  design has-patch has-screenshots   |  administration
-------------------------------------+-------------------------------------
Changes (by afercia):

 * keywords:  needs-testing needs-design has-patch => needs-testing needs-
     design has-patch has-screenshots
 * focuses:  administration => accessibility, administration


Comment:

 Looking at [attachment:"CustomPostTypeAsHomePages.ui.refreeh.2.patch"]
 only from a UI / accessibility perspective: the markup needs improvements.

 - there are now two form elements, the radio button and the new select,
 wrapped within the same `<label>` element: this isn't okay as the form
 elements aren't labelled correctly
 - these two form elements need to be separated and have their own
 meaningful, properly associated, `<label>`s
 - the select element can't be used as part of the radio button labelling
 - the `<label>`s need to communicate ''what'' the form elements are about
 - a group of radio buttons is supposed to be used with keyboard by using
 the arrow keys, but now there's a select element between the two buttons:
 at this point I wonder whether radio buttons are the best type of form
 elements for this UI
 - regardless, the `<label>`s text needs to be changed and also be
 translatable: the text needs to be a fully translatable string

 Something along these lines would be better:
 - Your latest posts (select the posts type below)
   - Posts type: [select element]
 - A static page (select below)

 However, this wouldn't solve the problem of the select element placed
 between the two radio buttons.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/19958#comment:40>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list