[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:56:54 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  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by flixos90):

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


Comment:

 @tabrisrp Thank you for the PR. Too bad we both worked on this apparently
 at the same time 🙃

 I also opened one in https://github.com/WordPress/wordpress-
 develop/pull/5069, which additionally implements a function to do the same
 for multiple options at the same time in a single DB request. I consider
 that useful particularly in plugin activation or deactivation hooks to
 bulk-modify the `autoload` value for options.

 I'm happy for either of us to continue the work, there's probably some
 bits in both PRs that should be used and combined. For example, my PR is
 missing the `wp_protect_special_option()` calls, while your PR is missing
 the logic to only update the DB if necessary, and to update the caches.

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


More information about the wp-trac mailing list