apply_filters( 'wp_default_autoload_value', bool|null $autoload, string $option, mixed $value, mixed $serialized_value )
- Since
- 6.6.0
Allows to determine the default autoload value for an option where no explicit value is passed.
Compatibility
- WordPress
- since 6.6.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$autoloadbool|null- The default autoload value to set. Returning true will be set as 'auto-on' in the database, false will be set as 'auto-off', and null will be set as 'auto'.
$optionstring- The passed option name.
$valuemixed- The passed option value to be saved.
$serialized_valuemixed- The passed option value to be saved, in serialized form.
Where this hook fires · 1
wp-includes/option.php:1333wp_determine_option_autoload_value()
Source code
* @param bool|null $autoload The default autoload value to set. Returning true will be set as 'auto-on' in the * database, false will be set as 'auto-off', and null will be set as 'auto'. * @param string $option The passed option name. * @param mixed $value The passed option value to be saved. * @param mixed $serialized_value The passed option value to be saved, in serialized form. */ $autoload = apply_filters( 'wp_default_autoload_value', null, $option, $value, $serialized_value ); if ( is_bool( $autoload ) ) { return $autoload ? 'auto-on' : 'auto-off'; } return 'auto';}Changelog
Introduced in 6.6.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter
$serialized_value added.verified against source6.6.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.