Skip to content

Commit

Permalink
Docs: Fix var types of parameters in sanitize_option() and `sanitiz…
Browse files Browse the repository at this point in the history
…e_option_{$option}`.

The related docblocks were previously defining `$value` and `$original_value` as if they were of type `string`, but they can also be of other types, like `array`.

Props gerardreches, crstauf, mukesh27.
Fixes #60214.
See #59651.





git-svn-id: https://develop.svn.wordpress.org/trunk@57302 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
audrasjb committed Jan 17, 2024
1 parent bb1c19f commit 935f4d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wp-includes/formatting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4846,8 +4846,8 @@ function wp_make_link_relative( $link ) {
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $option The name of the option.
* @param string $value The unsanitized value.
* @return string Sanitized value.
* @param mixed $value The unsanitized value.
* @return mixed Sanitized value.
*/
function sanitize_option( $option, $value ) {
global $wpdb;
Expand Down Expand Up @@ -5119,9 +5119,9 @@ function sanitize_option( $option, $value ) {
* @since 2.3.0
* @since 4.3.0 Added the `$original_value` parameter.
*
* @param string $value The sanitized option value.
* @param mixed $value The sanitized option value.
* @param string $option The option name.
* @param string $original_value The original value passed to the function.
* @param mixed $original_value The original value passed to the function.
*/
return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
}
Expand Down

0 comments on commit 935f4d1

Please sign in to comment.