Make WordPress Core

Changeset 57302

Timestamp:
01/17/2024 09:07:15 AM (7 months ago)
Author:
audrasjb
Message:

Docs: Fix var types of parameters in sanitize_option() and sanitize_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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/formatting.php

    r57263 r57302  
    48474847 *
    48484848 * @param string $option The name of the option.
    4849  * @param string $value  The unsanitized value.
    4850  * @return string Sanitized value.
     4849 * @param $value  The unsanitized value.
     4850 * @return Sanitized value.
    48514851 */
    48524852function sanitize_option( $option, $value ) {
     
    51205120     * @since 4.3.0 Added the `$original_value` parameter.
    51215121     *
    5122      * @param string $value          The sanitized option value.
     5122     * @param $value          The sanitized option value.
    51235123     * @param string $option         The option name.
    5124      * @param string $original_value The original value passed to the function.
     5124     * @param $original_value The original value passed to the function.
    51255125     */
    51265126    return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
Note: See TracChangeset for help on using the changeset viewer.