[wp-trac] [WordPress Trac] #58964: Introduce dedicated function to set autoload value of an option already in the database

WordPress Trac noreply at wordpress.org
Thu Aug 24 18:10:43 UTC 2023


#58964: Introduce dedicated function to set autoload value of an option already in
the database
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  6.4
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests dev-        |     Focuses:
  feedback                                       |  performance
-------------------------------------------------+-------------------------
Changes (by tabrisrp):

 * keywords:  has-patch has-unit-tests => has-patch has-unit-tests dev-
     feedback


Comment:

 I started a PR to add the new function, with unit tests associated.

 I did not yet do changes to `update_option()` because I wanted to discuss
 how best to implement that, as currently the function uses `get_option()`
 to get the old value, but there is nothing to get the old autoload value
 (and I don't think there is anything existing to get a specific option
 autoload value?).

 We could add an additional SQL request to get the option autoload value,
 but this has performance implications. I could also see the possiblity of
 changing the code to get the old value & autoload value at the same time,
 so feedback on the different possibilities would be appreciated!

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


More information about the wp-trac mailing list