wp_magic_quotes()

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

Add magic quotes to $_GET, $_POST, $_COOKIE, and $_SERVER.

Description

Also forces $_REQUEST to be $_GET + $_POST. If $_SERVER, $_COOKIE, or $_ENV are needed, use those superglobals directly.

Source

File: wp-includes/load.php

function wp_magic_quotes() {
	// Escape with wpdb.
	$_GET    = add_magic_quotes( $_GET );
	$_POST   = add_magic_quotes( $_POST );
	$_COOKIE = add_magic_quotes( $_COOKIE );
	$_SERVER = add_magic_quotes( $_SERVER );

	// Force REQUEST to be GET + POST.
	$_REQUEST = array_merge( $_GET, $_POST );
}

Changelog

Version Description
3.0.0 Introduced.

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