wp_unregister_globals

函式
wp_unregister_globals ( No parameters )

wp_unregister_globals: 這個函式取消了PHP在”register_globals”模式下執行時註冊的全域性變數。”register_globals”模式是PHP中一個被棄用的功能,允許變數從HTTP請求中被註冊為全域性變數: 當WordPress檢測到”register_globals”開啟時,它會呼叫這個函式來取消對全域性變數的註冊以防止安全漏洞。

關閉註冊全域性設定。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_unregister_GLOBALS() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
// register_globals was deprecated in PHP 5.3 and removed entirely in PHP 5.4.
_deprecated_function( __FUNCTION__, '5.5.0' );
}
function wp_unregister_GLOBALS() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid // register_globals was deprecated in PHP 5.3 and removed entirely in PHP 5.4. _deprecated_function( __FUNCTION__, '5.5.0' ); }
function wp_unregister_GLOBALS() {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
	// register_globals was deprecated in PHP 5.3 and removed entirely in PHP 5.4.
	_deprecated_function( __FUNCTION__, '5.5.0' );
}

常見問題

FAQs
檢視更多 >