Ticket #4695 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

pre_option_{option_name} filter does not work if returned value evaluates as false

Reported by: markjaquith Assigned to: anonymous
Priority: normal Milestone: 2.3
Component: General Version: 2.2.1
Severity: normal Keywords: filter pre_option_
Cc:

Description

<?php
require_once('wp-config.php');
update_option('blog_public', '1');

function return_zero($option_val) {
	return 0;
}

add_filter('pre_option_blog_public', 'return_zero');

var_dump(get_option('blog_public'));
?>

Expected result is:

string(1) "0"

Actual result is:

string(0) "1"

Patch is on the way.

Change History

08/02/07 22:51:43 changed by markjaquith

  • status changed from new to closed.
  • resolution set to fixed.

(In [5842]) Allow pre_option_ filters to return values that evaluate as false. fixes #4695