Yoast_Network_Settings_API::filter_default_option()publicYoast 1.0

Filters the default value for a network option.

This function is added as a filter to default_site_option_{$option} for network options that are registered with a default.

Метод класса: Yoast_Network_Settings_API{}

Хуков нет.


Разное. The filtered default value.


$Yoast_Network_Settings_API = new Yoast_Network_Settings_API();
$Yoast_Network_Settings_API->filter_default_option( $default_value, $option );
$default_value(разное) (обязательный)
Existing default value to return.
$option(строка) (обязательный)
The option name.

Код Yoast_Network_Settings_API::filter_default_option() Yoast 22.1

public function filter_default_option( $default_value, $option ) {

	// If a default value was manually passed to the function, allow it to override.
	if ( $default_value !== false ) {
		return $default_value;

	if ( empty( $this->registered_settings[ $option ] ) ) {
		return $default_value;

	return $this->registered_settings[ $option ]['default'];