Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#10893 closed defect (bug) (fixed)

get_site_option should activate the same filters as the mu version

Reported by: mark-k's profile mark-k Owned by: westi's profile westi
Milestone: 2.9 Priority: lowest
Severity: normal Version: 2.8.4
Component: General Keywords: reporter-feedback needs-testing
Focuses: Cc:

Description

No much point in having the same function names if they behave differently.

Namely, call the pre_site_option_${key} filter before getting the option and site_option_${key} to filter the return value.

Attachments (1)

site-option-mu-filters.diff (1.3 KB) - added by westi 14 years ago.
Patch for the filters

Download all attachments as: .zip

Change History (6)

@westi
14 years ago

Patch for the filters

#1 @westi
14 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Unassigned to 2.9
  • Owner set to westi
  • Status changed from new to accepted

How is that?

Does this give you the same behaviour.

#2 @mark-k
14 years ago

Yes, thanks,

#3 @westi
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [11995]) Make the (add|get|update)_site_option functions run the same filters in WP as they do in mu. Fixes #10893.

#4 follow-up: @hakre
14 years ago

  • Keywords needs-testing added
  • Resolution fixed deleted
  • Status changed from closed to reopened

some feedback on the (as untested marked but comitted) patch:

$key is not validated in any of these functions.

a filter returning false as the value FAILS to work.

#5 in reply to: ↑ 4 @westi
14 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

Replying to hakre:

some feedback on the (as untested marked but comitted) patch:

$key is not validated in any of these functions.

The same as the mu function and the same as get_option itself.

a filter returning false as the value FAILS to work.

The same as the mu function and the same as get_option itself.

The idea behind this change was for that same behaviour to be preserved.

Closing as FIXED.

If you wish you could open a new ticket for a future release to all for shortcircuit to return false and be used.

Note: See TracTickets for help on using tickets.