Function: filter_default_option

filter_default_option( mixed $default, string $option, boolean $passed_default )

Filter the default value for the option.

Shortcut: fdo

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.

For settings which register a default setting in register_setting(), this function is added as a filter to default_option_$option.

Parameters

Name Type(s) Default Value Description
$default mixed

Existing default value to return.

$option string

Option name.

$passed_default boolean

Was get_option() passed a default value?

Returns

mixed

Filtered default value.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.