Text" => "Heading Text"). $text = preg_replace( '#<(br|/p|/h[1-6]|/li|/div|/ul|/ol|/blockquote|/tr|/td|/th|/figcaption)\b[^>]*>#i', '$0 ', (string) $text ); $text = wp_strip_all_tags( $text ); $text = html_entity_decode( $text, ENT_QUOTES | ENT_HTML5, 'UTF-8' ); $text = preg_replace( '/[\s\x{00A0}]+/u', ' ', $text ); return trim( (string) $text ); } /** * Trim plain text (output of evoka_plain_text()) to a number of words. * * Unlike wp_trim_words() this does not strip tags again, so decoded text * such as "a