Warning: This function has been deprecated. Use esc_attr() instead.

attribute_escape() WordPress Function

The attribute_escape() function is used to escape HTML attributes. This function is useful for making sure that your HTML attributes are safe from XSS attacks.

attribute_escape( string $text ) #

Escaping for HTML attributes.


Description

Top ↑

See also


Top ↑

Parameters

$text

(string)(Required)


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/deprecated.php

function attribute_escape( $text ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_attr()' );
	return esc_attr( $text );
}


Top ↑

Changelog

Changelog
VersionDescription
2.8.0Use esc_attr()
2.0.6Introduced.

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.

Show More