Filters the value of an existing option before it is retrieved.
The dynamic portion of the hook name, $option, refers to the option name.
Returning a value other than false from the filter will short-circuit retrieval and return that value instead.
$pre_optionmixed
$default_value, which is used as the fallback value in the event the option doesn’t exist elsewhere in get_option() .$optionstring
$default_valuemixed
pre_option_posts_per_page
pre_option_posts_per_rss
pre_option_template
pre_option_stylesheet
pre_option_blog_charset
pre_option_home
...
wp_load_alloptions()$pre = apply_filters( "pre_option_{$option}", false, $option, $default_value );
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/pre_option_option