Codex

Function Reference/esc attr

Contents

Description

Encodes < > & " ' (less than, greater than, ampersand, double quote, single quote). Will never double encode entities

Usage

<?php esc_attr$text ?>

Parameters

$text
(string) (required) The text which is to be encoded.
Default: None

Return Values

(string) 
The encoded text with HTML entities.

Examples

Change Log

Since: 2.8.0

Source File

esc_attr() is located in wp-includes/formatting.php.

Related

See also index of Function Reference and index of Template Tags.