In `sanitize_option()`, pass the unsanitized `$value` to the filter.
Props simonwheatley, MikeHansenMe. Fixes #26199. Built from https://develop.svn.wordpress.org/trunk@32520 git-svn-id: http://core.svn.wordpress.org/trunk@32490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
33b61a9244
commit
33b99991a8
|
@ -3328,6 +3328,8 @@ function wp_make_link_relative( $link ) {
|
||||||
function sanitize_option($option, $value) {
|
function sanitize_option($option, $value) {
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
|
$original_value = $value;
|
||||||
|
|
||||||
switch ( $option ) {
|
switch ( $option ) {
|
||||||
case 'admin_email' :
|
case 'admin_email' :
|
||||||
case 'new_admin_email' :
|
case 'new_admin_email' :
|
||||||
|
@ -3515,11 +3517,13 @@ function sanitize_option($option, $value) {
|
||||||
* Filter an option value following sanitization.
|
* Filter an option value following sanitization.
|
||||||
*
|
*
|
||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
|
* @since 4.3.0 Added the `$original_value` parameter.
|
||||||
*
|
*
|
||||||
* @param string $value The sanitized option value.
|
* @param string $value The sanitized option value.
|
||||||
* @param string $option The option name.
|
* @param string $option The option name.
|
||||||
|
* @param string $original_value The original value passed to the function.
|
||||||
*/
|
*/
|
||||||
$value = apply_filters( "sanitize_option_{$option}", $value, $option );
|
$value = apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.3-alpha-32519';
|
$wp_version = '4.3-alpha-32520';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue