[wp-trac] [WordPress Trac] #29533: wp_trim_words preserves HTML tags
WordPress Trac
noreply at wordpress.org
Fri Sep 5 21:50:39 UTC 2014
#29533: wp_trim_words preserves HTML tags
-------------------------------------+------------------------------
Reporter: Mekku | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: trunk
Severity: normal | Resolution:
Keywords: reporter-feedback close | Focuses:
-------------------------------------+------------------------------
Changes (by nacin):
* keywords: reporter-feedback => reporter-feedback close
Comment:
I think wp_trim_words() is already pretty complicated (3 arguments). This
would also make it significantly more complicated, because it's not just
about removing the call to wp_strip_all_tags() — it'd also be about
trimming it to the correct number of words regardless of HTML tags, and
then returning those words with the HTML tags in tact. (And with balanced
tags, no less.) I don't want to mess with any of this in core as we have
no use for it.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29533#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list