[wp-trac] [WordPress Trac] #38176: Add 'default' to register_setting

WordPress Trac noreply at wordpress.org
Tue Oct 25 17:07:22 UTC 2016


#38176: Add 'default' to register_setting
-------------------------------------------------+-------------------------
 Reporter:  rmccue                               |       Owner:  joehoyle
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  4.7
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch dev-feedback needs-dev-    |     Focuses:
  note needs-refresh                             |
-------------------------------------------------+-------------------------
Changes (by joehoyle):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"38910"]:
 {{{
 #!CommitTicketReference repository="" revision="38910"
 Options: Add 'default' to register_setting

 Add a `default` argument to `register_setting` that will be used an the
 default option value viet `get_option()` in the event of no other option
 being specified. This means (if chosen) developers can define their
 default once via `register_option` and not have to duplicate the value
 every time they make a call to `get_option()`.

 Props rmccue, jorbin, jtsternberg.
 Fixes #38176.
 }}}

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


More information about the wp-trac mailing list