[wp-trac] [WordPress Trac] #51137: wp_terms_checklist not checking selected taxonomy items with selected_cats option

WordPress Trac noreply at wordpress.org
Tue Aug 25 15:49:54 UTC 2020


#51137: wp_terms_checklist not checking selected taxonomy items with selected_cats
option
--------------------------+-----------------------------------------
 Reporter:  brianhogg     |       Owner:  SergeyBiryukov
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  5.5.1
Component:  Taxonomy      |     Version:  5.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  template, coding-standards
--------------------------+-----------------------------------------
Changes (by SergeyBiryukov):

 * owner:  (none) => SergeyBiryukov
 * status:  new => reviewing
 * component:  General => Taxonomy


Comment:

 Hi there, welcome back to WordPress Trac! Thanks for the report.

 I agree this should be fixed in 5.5.1. I thought I verified that
 `$args['selected_cats']` is an array of integers here, but apparently
 that's not always the case.

 As noted above, `array_map( 'intval', ... )` would be the way to go here,
 as removing the strict check would just reintroduce the coding standards
 issue.

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


More information about the wp-trac mailing list