[wp-trac] [WordPress Trac] #29533: wp_trim_words preserves HTML tags

WordPress Trac noreply at wordpress.org
Fri Sep 5 11:20:22 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  |     Focuses:
-------------------------------+------------------------------
Changes (by karpstrucking):

 * keywords:   => reporter-feedback


Comment:

 Hi Mekku,

 Can you provide an example use-case? I suspect there will be a way to
 accomplish what you want without requiring a change to core. For example,
 if you are calling `wp_trim_words()` directly in your theme/plugin, you
 could just include and use your own modified version `my_wp_trim_words()`.
 If you are wanting to modify the standard post excerpt to include certain
 HTML elements, you can make use of the
 [https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
 includes/formatting.php#L2557 wp_trim_excerpt] filter

--
Ticket URL: <https://core.trac.wordpress.org/ticket/29533#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list