Alert: 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.

wp_magic_quotes() WordPress Function

The wp_magic_quotes() function is used to automatically add slashes to certain characters in a string. This is useful for ensuring that data submitted to a Wordpress database is properly formatted.

wp_magic_quotes() #

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.


Top ↑

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.