[wp-trac] [WordPress Trac] #51352: Unexpected behavior when switching autoload between update_option

WordPress Trac noreply at wordpress.org
Tue Jul 11 22:22:38 UTC 2023


#51352: Unexpected behavior when switching autoload between update_option
-------------------------------------------------+-------------------------
 Reporter:  pentatonicfunk                       |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.3
Component:  Options, Meta APIs                   |     Version:  trunk
 Severity:  major                                |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing 2nd-opinion                            |
-------------------------------------------------+-------------------------
Changes (by azaozz):

 * keywords:  has-patch has-unit-tests needs-testing => has-patch has-unit-
     tests needs-testing 2nd-opinion


Comment:

 Actually it is such a bad idea to be able to change `autoload` when
 updating an option. Not sure why it was ever made possible.

 As far as I see `autoload` is a low level DB setting that was intended to
 be set once when adding a new option and never changed. What's the point
 in changing it on every update of the option?

 Seems a good fix for this ticket would be to deprecate and remove the
 possibility to change `autoload` when updating options. As
 `update_option()` can also be used to add new options, the `$autoload =
 null` parameter would need to stay, but it would be used only when
 redirecting to `add_option()`.

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


More information about the wp-trac mailing list