addslashes_gpc

The timeline below displays how wordpress function addslashes_gpc has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Adds slashes to a string or recursively adds slashes to strings within an array.
 *
 * @since 0.71
 *
 * @param string|array $gpc String or array of data to slash.
 * @return string|array Slashed `$gpc`.
 */
function addslashes_gpc($gpc)
{
    return wp_slash($gpc);
}

WordPress Version: 5.9

/**
 * Adds slashes to a string or recursively adds slashes to strings within an array.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * https://www.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string|array $gpc String or array of data to slash.
 * @return string|array Slashed `$gpc`.
 */
function addslashes_gpc($gpc)
{
    return wp_slash($gpc);
}

WordPress Version: 5.4

/**
 * Adds slashes to escape strings.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * https://www.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string $gpc The string returned from HTTP request data.
 * @return string Returns a string escaped with slashes.
 */
function addslashes_gpc($gpc)
{
    return wp_slash($gpc);
}

WordPress Version: 5.3

/**
 * Adds slashes to escape strings.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * https://secure.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string $gpc The string returned from HTTP request data.
 * @return string Returns a string escaped with slashes.
 */
function addslashes_gpc($gpc)
{
    return wp_slash($gpc);
}

WordPress Version: 4.6

/**
 * Adds slashes to escape strings.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * https://secure.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string $gpc The string returned from HTTP request data.
 * @return string Returns a string escaped with slashes.
 */
function addslashes_gpc($gpc)
{
    if (get_magic_quotes_gpc()) {
        $gpc = stripslashes($gpc);
    }
    return wp_slash($gpc);
}

WordPress Version: 3.7

/**
 * Adds slashes to escape strings.
 *
 * Slashes will first be removed if magic_quotes_gpc is set, see {@link
 * http://www.php.net/magic_quotes} for more details.
 *
 * @since 0.71
 *
 * @param string $gpc The string returned from HTTP request data.
 * @return string Returns a string escaped with slashes.
 */
function addslashes_gpc($gpc)
{
    if (get_magic_quotes_gpc()) {
        $gpc = stripslashes($gpc);
    }
    return wp_slash($gpc);
}