[wp-trac] [WordPress Trac] #28773: add_filter not working as expected with 'no_texturize_shortcodes'
WordPress Trac
noreply at wordpress.org
Mon Jul 7 11:45:17 UTC 2014
#28773: add_filter not working as expected with 'no_texturize_shortcodes'
--------------------------+-----------------------------
Reporter: pgn4web | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 3.9.1
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Hello I have a plugin that created a shortcode, for example [my] ... [/my]
In the plugin code, in order to avoid text in-between the shortcode tags
to be changed, I added this code:
{{{
function my_no_texurize( $shortcodes ) {
$shortcodes[] = 'my';
return $shortcodes;
}
add_filter( 'no_texturize_shortcodes', 'my_no_texturize' );
}}}
Using this code actually stops the texturization of the tag, however this
applies to all tags (not only for my tag). With a bit of investigation, I
discovered that replacing the code above with the following also works for
all tags:
{{{
add_filter( 'no_texturize_shortcodes', 'function_that_does_not_exist' );
}}}
I also found that the following code restores the expected behavior of
disabling texturization for only the intended tags (note that I'm passing
to add_filter a function pointer not a function name):
{{{
function my_no_texurize( $shortcodes ) {
$shortcodes[] = 'my';
return $shortcodes;
}
add_filter( 'no_texturize_shortcodes', my_no_texturize );
}}}
The above works but it's not consistent with the documentation at
http://codex.wordpress.org/Plugin_API/Filter_Reference/no_texturize_shortcodes
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28773>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list