WordPress 6.4 introduces a number of new functions related to options, with a particular focus on autoloaded options.\n\n\n\nWhile options are autoloaded by default, based on the $autoload parameter of add_option() and update_option(), autoloading too many options is a common cause for slow server response time as well as bugs while using a persistent object cache.\n\n\n\nTo help plugin developers improve managing their plugins\u2019 options, their performance, and whether to autoload them, two sets of functions are being introduced in 6.4:\n\n\n\n\nwp_prime_option_caches() and related wrapper functions can be used to fetch multiple options with a single database query. Update: When this dev note was first published, the function was named prime_options(), however that name was since revised to wp_prime_option_caches().\n\n\n\nwp_set_option_autoload_values() and related wrapper functions can be used to update one or more specific options\u2019 autoload values, independently of their option values.\n\n\n\n\nNew functions to retrieve multiple options in a single database query\n\n\n\nThe wp_prime_option_caches( $options ) function expects an array of option names, and then fetches any options that aren\u2019t already cached with a single database query. The options are then stored in the cache so that subsequent get_option() calls for any of those options do not result in separate database queries.\n\n\n\nNote that wp_prime_option_caches() does not return the options as its sole responsibility is to update the relevant caches. In order to actually retrieve multiple options at once, a new wrapper function get_options( $options ) has been introduced. It calls wp_prime_option_caches() for the option names given and then get_option() for every individual option, returning an associative array of option names and their values.\n\n\n\nLast but not least, a third function wp_prime_option_caches_by_group() is being introduced, which primes all options of a specific option group (the mandatory first parameter of register_setting()). This can be helpful for plugins to fetch all options of a specific option group the plugin uses.\n\n\n\nAll of the above functions have been introduced not only as a performant way to retrieve multiple options from the database, but also as an alternative to autoloading options that are only needed in a few specific areas. For example, a plugin that currently autoloads a few options which are only used on the plugin\u2019s own WP Admin screen would be encouraged to use the new wp_prime_option_caches() or wp_prime_option_caches_by_group() instead of autoloading the options.\n\n\n\nExample\n\n\n\nIn this example, we assume a plugin has a WP Admin screen that relies on four options: \u201cmyplugin_foo\u201d, \u201cmyplugin_bar\u201d, \u201cmyplugin_foobar\u201d, and \u201cmyplugin_barfoo\u201d. All of these options are only used on that admin screen and therefore should not be autoloaded. In other words, any add_option() and update_option() calls for those options should provide \u201cno\u201d for the $autoload parameter.\n\n\n\nfunction myplugin_prime_admin_screen_options() {\n\t\/*\n\t * By priming the options here, no further database queries will be used\n\t * when later calling `get_option()`.\n\t *\/\n\twp_prime_option_caches(\n\t\tarray( 'myplugin_foo', 'myplugin_bar', 'myplugin_foobar', 'myplugin_barfoo' )\n\t);\n}\n\nfunction myplugin_add_admin_screen() {\n\t$hook_suffix = add_menu_page( \/* Menu page arguments. *\/ );\n\tadd_action( \"load-{$hook_suffix}\", 'myplugin_prime_admin_screen_options' );\n}\nadd_action( 'admin_menu', 'myplugin_add_admin_screen' );\n\n\n\nThis code would ensure that the options are retrieved in a single database query. Any subsequent get_option() calls for these options would then not result in another database query and thus be extremely fast. As such, the WP Admin screen is just as performant as it would have been with autoloading those options, yet without unnecessarily slowing down performance of the entire site.\n\n\n\nTo further enhance that example, the plugin could rely on a single option group for which it registers those options. Here is the example code for that:\n\n\n\nfunction myplugin_register_settings() {\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_foo',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_bar',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_foobar',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_barfoo',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n}\nadd_action( 'init', 'myplugin_register_settings' );\n\nfunction myplugin_prime_admin_screen_options() {\n\t\/*\n\t * By priming the options here, no further database queries will be used\n\t * when later calling `get_option()`.\n\t *\/\n\twp_prime_option_caches_by_group( 'myplugin_admin_screen' );\n}\n\n\/\/ `myplugin_add_admin_screen()` would remain as in the previous code example.\n\n\n\nWith that adjustment, the option registration would be the central place to manage the options, and the myplugin_prime_admin_screen_options() function would remain simple without maintaining a list of the exact options.\n\n\n\nPlease refer to Trac ticket #58962 for additional details on these changes.\n\n\n\nNew functions to set option autoload values\n\n\n\nThe wp_set_option_autoload_values( array $options ) function expects an associative array of option names and their autoload values to set, and then updates those options\u2019 autoload values in a single database query.\n\n\n\nAdditionally, two wrapper functions for the above are also being introduced for ease of use:\n\n\n\n\nwp_set_options_autoload( $options, $autoload ) can be used to set multiple options to the same autoload value.\n\n\n\nwp_set_option_autoload( $option, $autoload ) can be used to set the autoload value for a single option.\n\n\n\n\nThese functions can be useful in a plugin deactivation hook: After deactivation, the plugin\u2019s options won\u2019t be used anymore, yet they should not be deleted from the database until the user decides to uninstall the plugin.\n\n\n\nExample\n\n\n\nIn this example, we assume a plugin has two options \u201cmyplugin_foo\u201d and \u201cmyplugin_bar\u201d, both of which are used in various frontend page loads and therefore autoloaded by default. To properly clean up after itself, such a plugin could implement usage of the new functions as follows:\n\n\n\nfunction myplugin_activate() {\n\twp_set_options_autoload(\n\t\tarray( 'myplugin_foo', 'myplugin_bar' ),\n\t\t'yes'\n\t);\n}\nregister_activation_hook( __FILE__, 'myplugin_activate' );\n\nfunction myplugin_deactivate() {\n\twp_set_options_autoload(\n\t\tarray( 'myplugin_foo', 'myplugin_bar' ),\n\t\t'no'\n\t);\n}\nregister_deactivation_hook( __FILE__, 'myplugin_deactivate' );\n\n\n\nThis code would ensure that the options are no longer autoloaded when the plugin has been deactivated. If the plugin gets (re-)activated, the options will be set to autoload again if they are already in the database.\n\n\n\nPlease refer to Trac ticket #58964 for additional details on these changes.\n\n\n\nRelated autoload bug fix for update_option()\n\n\n\nWhile not directly tied to the above functions, it is worth noting that a bug relevant to autoloading has been addressed in 6.4: When using the $autoload parameter of update_option() alongside an option value update, the function would update the incorrect cache, not respecting the new autoload value. This could have severe implications such as returning a stale option value when the option in fact had already been deleted.\n\n\n\nThis bug has been fixed in 6.4, so that the $autoload parameter of update_option() can now be reliably used to change the option\u2019s autoload value. It should be noted though that depending on the use-case the above functions to set option autoload values may be more suitable.\n\n\n\nPlease refer to Trac ticket #51352 for additional details on this bug fix.\n\n\n\nProps to @westonruter and @webcommsat for review and proofreading.\n\n\n#6-4, #dev-notes, #dev-notes-6-4, #performance","contentFiltered":"WordPress 6.4 introduces a number of new functions related to options, with a particular focus on autoloaded options.\n\n\n\nWhile options are autoloaded by default, based on the $autoload parameter of add_option() and update_option(), autoloading too many options is a common cause for slow server response time as well as bugs while using a persistent object cache.\n\n\n\nTo help pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https:\/\/wordpress.org\/plugins\/ or can be cost-based plugin from a third-party developers improve managing their plugins\u2019 options, their performance, and whether to autoload them, two sets of functions are being introduced in 6.4:\n\n\n\n\nwp_prime_option_caches() and related wrapper functions can be used to fetch multiple options with a single database query. Update: When this dev notedev note Each important change in WordPress Core is documented in a developers note, (usually called dev note). Good dev notes generally include a description of the change, the decision that led to this change, and a description of how developers are supposed to work with that change. Dev notes are published on Make\/Core blog during the beta phase of WordPress release cycle. Publishing dev notes is particularly important when plugin\/theme authors and WordPress developers need to be aware of those changes.In general, all dev notes are compiled into a Field Guide at the beginning of the release candidate phase. was first published, the function was named prime_options(), however that name was since revised to wp_prime_option_caches().\n\n\n\nwp_set_option_autoload_values() and related wrapper functions can be used to update one or more specific options\u2019 autoload values, independently of their option values.\n\n\n\n\nNew functions to retrieve multiple options in a single database query\n\n\n\nThe wp_prime_option_caches( $options ) function expects an array of option names, and then fetches any options that aren\u2019t already cached with a single database query. The options are then stored in the cache so that subsequent get_option() calls for any of those options do not result in separate database queries.\n\n\n\nNote that wp_prime_option_caches() does not return the options as its sole responsibility is to update the relevant caches. In order to actually retrieve multiple options at once, a new wrapper function get_options( $options ) has been introduced. It calls wp_prime_option_caches() for the option names given and then get_option() for every individual option, returning an associative array of option names and their values.\n\n\n\nLast but not least, a third function wp_prime_option_caches_by_group() is being introduced, which primes all options of a specific option group (the mandatory first parameter of register_setting()). This can be helpful for plugins to fetch all options of a specific option group the plugin uses.\n\n\n\nAll of the above functions have been introduced not only as a performant way to retrieve multiple options from the database, but also as an alternative to autoloading options that are only needed in a few specific areas. For example, a plugin that currently autoloads a few options which are only used on the plugin\u2019s own WP Adminadmin (and super admin) screen would be encouraged to use the new wp_prime_option_caches() or wp_prime_option_caches_by_group() instead of autoloading the options.\n\n\n\nExample\n\n\n\nIn this example, we assume a plugin has a WP Admin screen that relies on four options: \u201cmyplugin_foo\u201d, \u201cmyplugin_bar\u201d, \u201cmyplugin_foobar\u201d, and \u201cmyplugin_barfoo\u201d. All of these options are only used on that admin screen and therefore should not be autoloaded. In other words, any add_option() and update_option() calls for those options should provide \u201cno\u201d for the $autoload parameter.\n\n\n\nfunction myplugin_prime_admin_screen_options() {\n\t\/*\n\t * By priming the options here, no further database queries will be used\n\t * when later calling `get_option()`.\n\t *\/\n\twp_prime_option_caches(\n\t\tarray( 'myplugin_foo', 'myplugin_bar', 'myplugin_foobar', 'myplugin_barfoo' )\n\t);\n}\n\nfunction myplugin_add_admin_screen() {\n\t$hook_suffix = add_menu_page( \/* Menu page arguments. *\/ );\n\tadd_action( \"load-{$hook_suffix}\", 'myplugin_prime_admin_screen_options' );\n}\nadd_action( 'admin_menu', 'myplugin_add_admin_screen' );\n\n\n\nThis code would ensure that the options are retrieved in a single database query. Any subsequent get_option() calls for these options would then not result in another database query and thus be extremely fast. As such, the WP Admin screen is just as performant as it would have been with autoloading those options, yet without unnecessarily slowing down performance of the entire site.\n\n\n\nTo further enhance that example, the plugin could rely on a single option group for which it registers those options. Here is the example code for that:\n\n\n\nfunction myplugin_register_settings() {\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_foo',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_bar',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_foobar',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n\tregister_setting(\n\t\t'myplugin_admin_screen',\n\t\t'myplugin_barfoo',\n\t\tarray( \/* Registration arguments. *\/ )\n\t);\n}\nadd_action( 'init', 'myplugin_register_settings' );\n\nfunction myplugin_prime_admin_screen_options() {\n\t\/*\n\t * By priming the options here, no further database queries will be used\n\t * when later calling `get_option()`.\n\t *\/\n\twp_prime_option_caches_by_group( 'myplugin_admin_screen' );\n}\n\n\/\/ `myplugin_add_admin_screen()` would remain as in the previous code example.\n\n\n\nWith that adjustment, the option registration would be the central place to manage the options, and the myplugin_prime_admin_screen_options() function would remain simple without maintaining a list of the exact options.\n\n\n\nPlease refer to TracTrac An open source project by Edgewall Software that serves as a bug tracker and project management tool for WordPress. ticketticket Created for both bug reports and feature development on the bug tracker. #58962 for additional details on these changes.\n\n\n\nNew functions to set option autoload values\n\n\n\nThe wp_set_option_autoload_values( array $options ) function expects an associative array of option names and their autoload values to set, and then updates those options\u2019 autoload values in a single database query.\n\n\n\nAdditionally, two wrapper functions for the above are also being introduced for ease of use:\n\n\n\n\nwp_set_options_autoload( $options, $autoload ) can be used to set multiple options to the same autoload value.\n\n\n\nwp_set_option_autoload( $option, $autoload ) can be used to set the autoload value for a single option.\n\n\n\n\nThese functions can be useful in a plugin deactivation hook: After deactivation, the plugin\u2019s options won\u2019t be used anymore, yet they should not be deleted from the database until the user decides to uninstall the plugin.\n\n\n\nExample\n\n\n\nIn this example, we assume a plugin has two options \u201cmyplugin_foo\u201d and \u201cmyplugin_bar\u201d, both of which are used in various frontend page loads and therefore autoloaded by default. To properly clean up after itself, such a plugin could implement usage of the new functions as follows:\n\n\n\nfunction myplugin_activate() {\n\twp_set_options_autoload(\n\t\tarray( 'myplugin_foo', 'myplugin_bar' ),\n\t\t'yes'\n\t);\n}\nregister_activation_hook( __FILE__, 'myplugin_activate' );\n\nfunction myplugin_deactivate() {\n\twp_set_options_autoload(\n\t\tarray( 'myplugin_foo', 'myplugin_bar' ),\n\t\t'no'\n\t);\n}\nregister_deactivation_hook( __FILE__, 'myplugin_deactivate' );\n\n\n\nThis code would ensure that the options are no longer autoloaded when the plugin has been deactivated. If the plugin gets (re-)activated, the options will be set to autoload again if they are already in the database.\n\n\n\nPlease refer to Trac ticket #58964 for additional details on these changes.\n\n\n\nRelated autoload bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. fix for update_option()\n\n\n\nWhile not directly tied to the above functions, it is worth noting that a bug relevant to autoloading has been addressed in 6.4: When using the $autoload parameter of update_option() alongside an option value update, the function would update the incorrect cache, not respecting the new autoload value. This could have severe implications such as returning a stale option value when the option in fact had already been deleted.\n\n\n\nThis bug has been fixed in 6.4, so that the $autoload parameter of update_option() can now be reliably used to change the option\u2019s autoload value. It should be noted though that depending on the use-case the above functions to set option autoload values may be more suitable.\n\n\n\nPlease refer to Trac ticket #51352 for additional details on this bug fix.\n\n\n\nProps to @westonruter and @webcommsat for review and proofreading.\n#6-4, #dev-notes, #dev-notes-6-4, #performanceShare this:TwitterFacebookLogin to Reply","permalink":"https:\/\/make.wordpress.org\/core\/2023\/10\/17\/new-option-functions-in-6-4\/","unixtime":1697580295,"unixtimeModified":1698362671,"entryHeaderMeta":"","linkPages":"","footerEntryMeta":"","tagsRaw":"6-4, dev-notes, dev-notes-6.4, performance","tagsArray":[{"label":"6-4","count":70,"link":"https:\/\/make.wordpress.org\/core\/tag\/6-4\/"},{"label":"dev-notes","count":505,"link":"https:\/\/make.wordpress.org\/core\/tag\/dev-notes\/"},{"label":"dev-notes-6.4","count":17,"link":"https:\/\/make.wordpress.org\/core\/tag\/dev-notes-6-4\/"},{"label":"performance","count":274,"link":"https:\/\/make.wordpress.org\/core\/tag\/performance\/"}],"loginRedirectURL":"https:\/\/login.wordpress.org\/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2023%2F10%2F17%2Fnew-option-functions-in-6-4%2F&locale=en_US","hasPrevPost":true,"prevPostTitle":"WordPress 6.4 Release Candidate Phase","prevPostURL":"https:\/\/make.wordpress.org\/core\/2023\/10\/17\/wordpress-6-4-release-candidate-phase\/","hasNextPost":true,"nextPostTitle":"Image loading optimization enhancements in 6.4","nextPostURL":"https:\/\/make.wordpress.org\/core\/2023\/10\/18\/image-loading-optimization-enhancements-in-6-4\/","commentsOpen":true,"is_xpost":false,"editURL":null,"postActions":"Post ActionsLogin to ReplyScrollShortlink","comments":[{"type":"comment","id":"45758","postID":"109116","postTitleRaw":"New option functions in 6.4","cssClasses":"comment byuser comment-author-mahesh901122 even thread-even depth-1","parentID":"0","contentRaw":"As we have functions `get_option()` and `update_option()`.\n\nSo, Will function names be:\n\n- `wp_load_options()` as `get_options()`\n- `wp_set_option_autoload_values()` and `update_options()`","contentFiltered":"As we have functions `get_option()` and `update_option()`.\nSo, Will function names be:\n\n`wp_load_options()` as `get_options()`\n\n`wp_set_option_autoload_values()` and `update_options()`\n\n\n","permalink":"https:\/\/make.wordpress.org\/core\/2023\/10\/17\/new-option-functions-in-6-4\/#comment-45758","unixtime":1698213420,"loginRedirectURL":"https:\/\/login.wordpress.org\/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2023%2F10%2F17%2Fnew-option-functions-in-6-4%2F%23comment-45758&locale=en_US","approved":true,"isTrashed":false,"prevDeleted":"","editURL":null,"depth":1,"commentDropdownActions":"","commentFooterActions":"Login to Reply","commentTrashedActions":"Untrash","mentions":[],"mentionContext":"","commentCreated":"1698213420","hasChildren":false,"userLogin":"Mahesh901122","userNicename":"mahesh901122"},{"type":"comment","id":"45769","postID":"109116","postTitleRaw":"New option functions in 6.4","cssClasses":"comment byuser comment-author-danieliser odd alt thread-odd thread-alt depth-1","parentID":"0","contentRaw":"OMG how was `get_options( $options )` not a thing already, seems so simple yet will lead to way less code & complexity once used in plugins & themes en-masse.","contentFiltered":"OMG how was `get_options( $options )` not a thing already, seems so simple yet will lead to way less code & complexity once used in plugins & themes en-masse.\n","permalink":"https:\/\/make.wordpress.org\/core\/2023\/10\/17\/new-option-functions-in-6-4\/#comment-45769","unixtime":1698310527,"loginRedirectURL":"https:\/\/login.wordpress.org\/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2023%2F10%2F17%2Fnew-option-functions-in-6-4%2F%23comment-45769&locale=en_US","approved":true,"isTrashed":false,"prevDeleted":"","editURL":null,"depth":1,"commentDropdownActions":"","commentFooterActions":"Login to Reply","commentTrashedActions":"Untrash","mentions":[],"mentionContext":"","commentCreated":"1698310527","hasChildren":false,"userLogin":"danieliser","userNicename":"danieliser"},{"type":"comment","id":"45848","postID":"109116","postTitleRaw":"New option functions in 6.4","cssClasses":"comment byuser comment-author-mujuonly even thread-even depth-1","parentID":"0","contentRaw":"+1","contentFiltered":"+1\n","permalink":"https:\/\/make.wordpress.org\/core\/2023\/10\/17\/new-option-functions-in-6-4\/#comment-45848","unixtime":1699946523,"loginRedirectURL":"https:\/\/login.wordpress.org\/?redirect_to=https%3A%2F%2Fmake.wordpress.org%2Fcore%2F2023%2F10%2F17%2Fnew-option-functions-in-6-4%2F%23comment-45848&locale=en_US","approved":true,"isTrashed":false,"prevDeleted":"","editURL":null,"depth":1,"commentDropdownActions":"","commentFooterActions":"Login to Reply","commentTrashedActions":"Untrash","mentions":[],"mentionContext":"","commentCreated":"1699946523","hasChildren":false,"userLogin":"mujuonly","userNicename":"mujuonly"}],"postFormat":"standard","postMeta":{"isSticky":false},"postTerms":{"category":[{"label":"General","count":2534,"link":"https:\/\/make.wordpress.org\/core\/category\/general\/"}],"post_tag":[{"label":"6-4","count":70,"link":"https:\/\/make.wordpress.org\/core\/tag\/6-4\/"},{"label":"dev-notes","count":505,"link":"https:\/\/make.wordpress.org\/core\/tag\/dev-notes\/"},{"label":"dev-notes-6.4","count":17,"link":"https:\/\/make.wordpress.org\/core\/tag\/dev-notes-6-4\/"},{"label":"performance","count":274,"link":"https:\/\/make.wordpress.org\/core\/tag\/performance\/"}],"post_format":[]},"pluginData":[],"isPage":false,"mentions":["westonruter","webcommsat"],"mentionContext":"","isTrashed":false,"userLogin":"flixos90","userNicename":"flixos90"}]Mahesh Waghmare5:57 am on October 25, 2023As we have functions `get_option()` and `update_option()`.


Download Bereich Wordpress


DOWNLOAD 🔥 https://bytlly.com/2y2NaO 🔥


 ff782bc1db

thank you next download deviantart

download the fema app

moovit turkey

ivms 4500 macbook download

philips hue effekte download