Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#38319 closed enhancement (fixed)

Add $network_id parameter to filters in `get_network_option()`

Reported by: flixos90's profile flixos90 Owned by: jeremyfelt's profile jeremyfelt
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Options, Meta APIs Keywords: has-patch has-dev-note
Focuses: multisite Cc:


I just noticed that the filters in get_network_option() do not receive the network ID passed to the function. This makes these filters useless for quite a few use-cases (for example when overriding the process of receiving a specific option via pre_site_option_{$option}).

The network ID should be added as a parameter to all these filters.

I will open similar tickets for the filters and actions in add_network_option(), update_network_option() and delete_network_option().

Attachments (1)

38319.diff (2.9 KB) - added by flixos90 8 years ago.

Download all attachments as: .zip

Change History (5)

8 years ago

#1 @flixos90
8 years ago

  • Keywords has-patch added; needs-patch removed

38319.diff introduces the $network_id parameter to the filters in get_network_option().

#2 @jeremyfelt
8 years ago

  • Milestone changed from Awaiting Review to 4.7
  • Owner set to jeremyfelt
  • Status changed from new to reviewing

Good catch. When we moved from get_site_option() to get_network_option() we made it possible to retrieve options from other networks, not just the current network.

Thanks @flixos90.

Related #38320, #38321, #38322.

#3 @jeremyfelt
8 years ago

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

In 38815:

Multisite: Add $network_id parameter to filters in get_network_option().

Props flixos90.
Fixes #38319.

#4 @desrosj
4 years ago

  • Keywords has-dev-note added

Linking the dev note that was published here for reference:

Note: See TracTickets for help on using tickets.