[wp-trac] [WordPress Trac] #18285: New Settings API and workflow

WordPress Trac wp-trac at lists.automattic.com
Thu Sep 1 20:26:11 UTC 2011


#18285: New Settings API and workflow
----------------------------+------------------
 Reporter:  nacin           |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  3.3
Component:  Plugins         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |
----------------------------+------------------

Comment (by WraithKenny):

 I'd like to make a case for some default, generic form element generation.
 A few optional "template tags" for option pages would be cool.  The
 templates could live in a file somewhere by itself to be included if
 wanted.

 As a theme/plugin developer, sometimes I just want to use what ever flavor
 of markup and style core is currently using for the admin. Hunting down
 class-names and such in Firebug aside, this markup and style may change in
 future versions, and as long as the default markup/style was optional
 /over-writable, I don't see it as a problem.

 Additionally, generic tags for simple text fields could have some safe
 easy optional default sanitation callbacks and output escaping. Remember,
 no one has to use them if they'd rather do it themselves. (If it's too
 hard, no one uses sanitation/escaping, and that's no good.)

 Potential list could include things like the new HTML5 types: email, url,
 number, range, date, color, time, etc., as well as other typical ones like
 Name, Phone Number, Address, Post-like Content (textareas which uses the
 appropriate kses automatically), and the generic ones, Select, Checkbox,
 Radio, etc. These functions could create the markup and style to match the
 standard admin uniformly, as well as apply a fallback sanitation callback
 and escaping appropriate for each one.

 These things would make it easier on everyone, but no one would be
 required to use them. If you have a special use-case, by all means, roll
 your own! But they'd be great to have and maintained somewhere central.

 We can't cover all cases. These functions could also provide a code
 example for developers attempting to write their own.

 To summarize:
  1. markup and style uniformity with core
  2. default data sanitation, validation and/or escaping handled
  3. template/example for rolling custom ones
  4. really convenient.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18285#comment:50>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list