[wp-trac] [WordPress Trac] #31119: `add_option()` with `$autoload = false` adds option with autoload of "yes"

WordPress Trac noreply at wordpress.org
Sun Jan 25 04:03:10 UTC 2015


#31119: `add_option()` with `$autoload = false` adds option with autoload of "yes"
--------------------------------+-----------------------------
 Reporter:  dlh                 |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  4.1
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 The docs for `add_option()` say that the `autoload` parameter accepts
 `string|bool`.

 This is accurate in that using a boolean won't cause an error, but the
 function checks only `'no' === $autoload`, such that if you call
 `add_option()` with `$autoload = false`, your option will be autoloaded.

 The attached patch adds support for `false` and adds a unit test  for
 `autoload` values after `add_option()`.

 Alternatively, the docs could be updated to just `string`.

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


More information about the wp-trac mailing list