Summery Summery

Filters the default value for the option.

Syntax Syntax

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

Description Description

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

Parameters Parameters


(Required) Existing default value to return.


(Required) Option name.


(Required) Was get_option() passed a default value?

Return Return

(mixed) Filtered default value.

Source Source

File: wp-includes/option.php

	 * Fires immediately before the setting is registered but after its filters are in place.
	 * @since 5.5.0
	 * @param string $option_group Setting group.
	 * @param string $option_name  Setting name.
	 * @param array  $args         Array of setting registration arguments.
	do_action( 'register_setting', $option_group, $option_name, $args );

	$wp_registered_settings[ $option_name ] = $args;


Changelog Changelog

Version Description
4.7.0 Introduced.


Leave a Reply