WordPress 果酱 - 2023-11-23T01:56:07Z
WordPress 6.4 引入一组与选项(option)相关的函数,主要是为了解决自动加载的选项相关的性能和其他一些问题。 自动加载选项的问题 首先 WordPress 的选项默认是自动加载的,这是基于 add_option() 和 upd …
AI生成摘要
WordPress 6.4 introduces a set of functions related to options, mainly to solve performance and other issues related to automatically loading options. The functions wp_prime_option_caches() and wp_set_option_autoload_values() can efficiently retrieve and update multiple options with a single SQL query. These functions can be used to replace global autoload options in specific scenarios. The article also provides examples of how to use these functions. Additionally, the wp_set_option_autoload_values() function allows for setting autoload values for multiple or single options. These functions are useful when a plugin is deactivated but the options should not be deleted from the database. WPJAM Basic and its related settings also utilize these options efficiently.