Make WordPress Core

Opened 6 months ago

Last modified 5 months ago

#61522 accepted enhancement

Add autoload control to register_setting()

Reported by: pbearne's profile pbearne Owned by: pbearne's profile 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 swissspidy)

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)

#1 @pbearne
6 months ago

  • Owner set to pbearne
  • Status changed from assigned to accepted

#2 @swissspidy
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

This commit introduces an autoload parameter in the register_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 the autoload parameter in the registration function as well as the corresponding changes in the database layout to store this information. This also includes a modification to wp_default_autoload_value filter to reflect the new autoload state. Changes are carried out across multiple files like theme-options.php, option.php, featured-content.php etc., for proper implementation.

Note: See TracTickets for help on using tickets.