[wp-trac] [WordPress Trac] #28975: Improve do_settings_fields() by including field ID on <tr> table row

WordPress Trac noreply at wordpress.org
Mon Jul 21 14:46:42 UTC 2014


#28975: Improve do_settings_fields() by including field ID on <tr> table row
--------------------------------+-----------------------------
 Reporter:  Jonnyauk            |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Administration      |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  ui, administration  |
--------------------------------+-----------------------------
 It would be very useful to target individual table rows (for
 Javascript/CSS manipulation) as generated using the WP settings API - but
 when looking at the source and do_settings_fields() it just has a
 hardcoded <tr> opening tag.

 I could search through using something like JQuery and see what's inside
 the table row - but this seems unnecessary when it would be more useful to
 add the ID of the settings 'field' straight into the <tr> tag as a class
 that can then be easily targeted.

 Please see submitted patch - small modification to do_settings_fields()
 that adds a CSS class so it can be easily targeted ;) I didn't use ID just
 in-case of multiple settings field ID's and therefore none-unique ID's
 (which surely would be bad practice and not function correctly using the
 WP Settings API anyway?!)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28975>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list