1. Home
  2. Wordpress
  3. Escape html
#wordpress#php

esc_html is a method allowing you to escape html from a string passed as an attribute.

$copy = "Text <span> with some html </span>."
/* Returns 'Text with some html'.

$escapeHtml = esc_html($copy);
/* Returns: 'Text <span> with some html </span>'.
copy
Full Wordpress cheatsheet
Sitemap Git repository