wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_filter_default_autoload_value_via_option_size is private and should not be used in themes or plugins directly.
wp_filter_default_autoload_value_via_option_size › WordPress Function
Since6.6.0
Deprecatedn/a
› wp_filter_default_autoload_value_via_option_size ( $autoload, $option, $value, $serialized_value )
| Access: |
|
| Parameters: (4) |
|
| Returns: |
|
| Defined at: |
|
| Codex: |
Filters the default autoload value to disable autoloading if the option value is too large.
Source
function wp_filter_default_autoload_value_via_option_size( $autoload, $option, $value, $serialized_value ) {
/**
* Filters the maximum size of option value in bytes.
*
* @since 6.6.0
*
* @param int $max_option_size The option-size threshold, in bytes. Default 150000.
* @param string $option The name of the option.
*/
$max_option_size = (int) apply_filters( 'wp_max_autoloaded_option_size', 150000, $option );
$size = ! empty( $serialized_value ) ? strlen( $serialized_value ) : 0;
if ( $size > $max_option_size ) {
return false;
}
return $autoload;
}