Opened 6 months ago
Last modified 5 months ago
#61522 accepted enhancement
Add autoload control to register_setting()
Reported by: | pbearne | Owned by: | pbearne |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Options, Meta APIs | Keywords: | has-patch has-unit-tests |
Focuses: | performance | Cc: |
Description (last modified by )
There doesn't seem to be a way to declare a setting does not need to be autoloaded (or loaded just in admin)
lets add this option to register_setting()
Change History (4)
#2
@
5 months ago
- Description modified (diff)
- Summary changed from allow control for if a setting should be autoloaded to Add autoload control to register_setting()
This ticket was mentioned in Slack in #core-performance by pbearne. View the logs.
5 months ago
This ticket was mentioned in PR #6994 on WordPress/wordpress-develop by @pbearne.
5 months ago
#4
- Keywords has-patch has-unit-tests added
Note: See
TracTickets for help on using
tickets.
This commit introduces an
autoload
parameter in theregister_setting
function, allowing users to specify if a setting should be autoloaded. Autoloaded settings are loaded on every page, improving the performance for settings that are frequently used. The change includes both the addition of theautoload
parameter in the registration function as well as the corresponding changes in the database layout to store this information. This also includes a modification towp_default_autoload_value
filter to reflect the new autoload state. Changes are carried out across multiple files liketheme-options.php
,option.php
,featured-content.php
etc., for proper implementation.