Un motore di ricerca WordPress per sviluppatori e autori di temi



filter_default_option ›

Da4.7.0
Deprecaton/a
filter_default_option ( $default, $option, $passed_default )
Parametri: (3)
  • (mixed) $default Existing default value to return.
    Richiesto:
  • (string) $option Option name.
    Richiesto:
  • (bool) $passed_default Was `get_option()` passed a default value?
    Richiesto:
Ritorna:
  • (mixed) Filtered default value.
Definito a:
Codex:

Filter the default value for the option.

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



Sorgenti

function filter_default_option( $default, $option, $passed_default ) {
	if ( $passed_default ) {
		return $default;
	}

	$registered = get_registered_settings();
	if ( empty( $registered[ $option ] ) ) {
		return $default;
	}

	return $registered[ $option ]['default'];
}