Opened 7 weeks ago
Last modified 7 weeks ago
#62735 reviewing defect (bug)
Change documented type of get_network_option, update_network_option and delete_network_option's $network_id parameter to int|null
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Options, Meta APIs | Keywords: | has-patch |
Focuses: | docs | Cc: |
Description
get_network_option, update_network_option and delete_network_option all have a $network_id as first parameter.
@param int $network_id ID of the network. Can be null to default to the current network ID.
It's @param type is set to INT yet it also explicitly says that NULL can be passed to use the current network ID. If passing NULL is valid then should the type not be INT|NULL?
Change History (3)
This ticket was mentioned in PR #8038 on WordPress/wordpress-develop by @im3dabasia1.
7 weeks ago
#1
- Keywords has-patch added
@im3dabasia1 commented on PR #8038:
7 weeks ago
#2
I also confirmed that int|null has been used in other functions, such as get_blog_count
, which internally calls get_network_option
: https://github.com/WordPress/wordpress-develop/blob/dc9b16ba4224259bd3ae2153f81686ed902391f2/src/wp-includes/ms-functions.php#L103-L117
#3
@
7 weeks ago
- Focuses php-compatibility removed
- Milestone changed from Awaiting Review to 6.8
- Owner set to audrasjb
- Status changed from new to reviewing
- Type changed from enhancement to defect (bug)
- Version trunk deleted
Hello and welcome to WordPress Core Trac @maikelraow,
Thanks for reporting this. Moving to milestone 6.8.
This PR updates the documented type of the $network_id parameter in
get_network_option
,update_network_option
, anddelete_network_option
methods to int|null, reflecting that NULL can be passed to default to the current network ID.