[wp-trac] [WordPress Trac] #25644: strip_shortcodes always removes text between shortcode tags, should be optional
WordPress Trac
noreply at wordpress.org
Mon Oct 21 21:22:41 UTC 2013
#25644: strip_shortcodes always removes text between shortcode tags, should be
optional
------------------------------------+------------------------------
Reporter: jonscaife | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Shortcodes | Version: 3.6.1
Severity: trivial | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------------------
Changes (by gMagicScott):
* cc: scott@… (added)
* keywords: has-patch => has-patch dev-feedback
Comment:
Replying to [comment:3 jonscaife]:
> Your solution sounds much smarter than mine! As long as it's possible
to avoid the distortion of content it works for me. Thanks
My proposed patch would expose the three arguments to the filter function,
an empty string, the shortcode attributes array, and the content. All the
function would need to do in your case is return the content
{{{
function my_filter_strip_shortcode_tag_highlight( $value, $attr, $content
= null ) {
if ( null === $content ) {
return $val;
}
return $content;
}
add_filter( 'strip_shortcode_tag_highlight',
'my_filter_strip_shortcode_tag_highlight', 10, 3 );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25644#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list