pre_site_option filter in get_network_option#10053
pre_site_option filter in get_network_option#10053nimesh-xecurify wants to merge 9 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
| // The global pre filter should short-circuit and return $return_val regardless of actual storage. | ||
| $this->assertSame( $return_val, get_network_option( $network_id, $option, $default_val ) ); | ||
| } finally { | ||
| remove_filter( 'pre_site_option', $callback, 10 ); |
There was a problem hiding this comment.
The try/catch shouldn't be needed, and no need to remove_filter(). They get reset after each test.
src/wp-includes/option.php
Outdated
| * @param int $network_id ID of the network. | ||
| * @param mixed $default_value The fallback value to return if the option does not exist. | ||
| * Default false. | ||
| *@since 6.9.0 |
There was a problem hiding this comment.
@since tag should add before @param tag
Adding unit test and making changes in @audrasjb 's PR (#10030) as per suggestions from @aaronjorbin
Trac ticket: https://core.trac.wordpress.org/ticket/56870