wppaste
WordPress

apply_filters( "sanitize_option_{$option}", mixed $value, string $option, mixed $original_value )

Since
2.3.0, 4.3.0
Filters an option value following sanitization.

Compatibility

WordPress
since 4.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$valuemixed
The sanitized option value.
$optionstring
The option name.
$original_valuemixed
The original value passed to the function.

Where this hook fires · 1

  • wp-includes/formatting.php:5119sanitize_option()

Source code

	 * @since 4.3.0 Added the `$original_value` parameter.	 *	 * @param mixed  $value          The sanitized option value.	 * @param string $option         The option name.	 * @param mixed  $original_value The original value passed to the function.	 */	return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );} /** * Maps a function to all non-iterable elements of an array or an object. * * This is similar to `array_walk_recursive()` but acts upon objects too.

Changelog

Introduced in 2.3.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

4.3.0
Added the $original_value parameter.from the docblock
2.3.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.