W3cubDocs

/WordPress

addslashes_gpc( string $gpc )

Adds slashes to escape strings.

Description

Slashes will first be removed if magic_quotes_gpc is set, see https://www.php.net/magic_quotes for more details.

Parameters

$gpc

(string) (Required) The string returned from HTTP request data.

Return

(string) Returns a string escaped with slashes.

Source

File: wp-includes/formatting.php

function addslashes_gpc( $gpc ) {
	return wp_slash( $gpc );
}

Changelog

Version Description
0.71 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/addslashes_gpc